arrival service
J1 0 12
J2 2 8
J3 3 4
J4 7 9
This repeats every 35 seconds [i.e. J5 arrives at 35 with service 12,
J6 arrives at 37 with service 8, etc.]
2. [9 pts] Implement binary semaphores in terms of counting semaphores. Do not use any other synchronization constructs. For constructs other than semaphores, assume only read/write atomicity and weak fairness progress. Your solution must be less than 30 lines and have no busy waiting. Elegance counts.
3. [8 pts] Consider an operating system that provides user processes with the following message-passing service:
The following questions are with regard to processes using the message-passing service. Give brief and precise answers. Irrelevant material will cost you points.
4. [4 pts] Consider a computer system where processes can have user-level threads. The cpu scheduler uses two-level round-robin as follows: A ready process is either in level A or level B. A-processes are served in round-robin order. B-processes are served in round-robin order but only when only when there are no A-processes. A A-process that accumulates more than 20 milliseconds of cpu time becomes a B-process. A B-process remains so until it stops being ready (i.e. ready or running).
Suppose the system has a set of processes that access a shared data structure using critical sections That is, the processes share a semaphore mutex initially 1, and every access is preceded by P(mutex) and succeeded by V(mutex).
Is it possible for the cpu scheduling and the processes to interact in a way that severely degrades the performance. Explain briefly?