Higher Study | Operating Systems | Concurrency and Synchronization

A certain computation generates two arrays a and b such that a[i]=f(i) for 0 ≤ i < n and b[i] = g (a[i] ) for 0 ≤ i < n. Suppose this computation is decomposed into two concurrent processes X and Y such that X computes the array a and Y computes the array b. The processes employ two binary semaphores R and S, both initialized to zero. The array a is shared by the two processes. The structures of the processes are shown below. Process X: private i; for (i=0; i<n; i++) {      a[i] = f(i);      ExitX(R, S); } Process Y: private i; for (i=0; i<n; i++) {       EntryY(R, S);       b[i] = g(a[i]); } Which one of the following represents the CORRECT implementations of ExitX and EntryY?
Each of a set of n processes executes the following code using two semaphores a and b initialized to 1 and 0, respectively. Assume that count is a shared variable initialized to 0 and not used in CODE SECTION P. CODE SECTION P wait (a); count=count+1 ; if (count==n) signal (b) ; signal (a) ; wait (b) ; signal (b) ; CODE SECTION Q What does the code achieve?
What problem is solved by Dijkstra banker’s algorithm?
Which of the following is not an optimization criterion in the design of a CPU scheduling algorithm?
Which of the following is/are the common services provided by an operating system?
Which of the following is not related to synchronization in Operating System?
The hardware implementation which provides mutual exclusion is
Ads