Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI 6307 Foundation of Systems – Exercise (3)

Similar presentations


Presentation on theme: "CSCI 6307 Foundation of Systems – Exercise (3)"— Presentation transcript:

1 CSCI 6307 Foundation of Systems – Exercise (3)
Xiang Lian The University of Texas – Pan American Edinburg, TX 78539

2 Direct-Mapped Cache Assume that we have a list of 16-bit memory address references: 6, 214, 175, 214, 6 Given a direct-mapped cache with 16 one-word blocks (initially empty), Please identify the binary address, the tag, and the index of the address references above Please also list if each address reference is a hit or a miss

3 Direct-Mapped Cache (cont'd)
16-bit memory address references: 6, 214, 175, 214, 6 a direct-mapped cache with 16 one-word blocks (initially empty) Address Reference Binary Tag Index Hit or Miss 6 214 175

4 Synchronization What is the function of a semaphore? What are the operations that can be applied to a semaphore? What is a condition variable? What are the operations that can be applied to a condition?

5 Write a Program Suppose processes p0 and p1 can access the same bank account (shared variable balance). Process p0 add "amount" to the account balance, whereas process p1 withdraw "amount" from the bank account. Please write a code fragment for processes p0 and p1 using the semaphore.

6 Process Scheduling Suppose that there are five processes in a system, their service time and arrival time are given below: Draw the Gantt chart and compute average waiting time for the following methods. Here the waiting time of a process includes all the times it is in the ready list. Assume the context switching time is negligible. 1. First-Come-First-Served 2. Shortest-Job-Next (non-preemptive) 3. Shortest-Remaining-Job-Next (i.e., preemptive SJN) 4. Round-Robin with time quantum of 2 5. Round-Robin with time quantum of 4 Process Arrival time Service time P1 7 P2 20 P3 5 P4 10 P5 8 4

7


Download ppt "CSCI 6307 Foundation of Systems – Exercise (3)"

Similar presentations


Ads by Google