Question: ( a ) Message buffers and message queues can be eliminated if processes exchange messages by rendezvous. In this scheme, a sender tries to find

(a) Message buffers and message queues can be eliminated if processes exchange messages by rendezvous. In this scheme, a sender tries to find whether an intended receiver is waiting for its message. If so, it copies the message to the receiver's address space and unblocks the receiver. If not, it waits. When a receiver runs, it tries to find a waiting sender which has message for it. If so, it copies the message and unblocks the sender. Otherwise, it waits,
(i) Prove that, in a uniprocessor kernel, both sender and receiver wait for each other cannot occur.
(ii) In a multiprocessor kernel, processes may run on separate processors in parallel. Can process rendezvous still work?
(b) Conceptually, the heap area of an execution image is in between the Data and Stack areas. This is because we would like to keep the stack at the high end of the virtual address space. In practice, the heap area can be located after the stack area, as shown below.
In this case, brk ()/sbrk () would extend the heap area toward the right.
(i) Show how to set the initial stack pointer of an image.
(ii) When the heap is expanded by brk()/sbrk(), is it necessary to adjust the stack frame pointers in the new image? Justify.
(c) Assume a counting Semaphore:
\[
\text { SEMAPHORE }\mathrm{s}=2 ; \quad /*\text { initial }\mathrm{s}\text {, value }=2,\mathrm{~s}\text {.queue }=0*/
\]
Show the value and queue of the semaphore AFTER each of the following sequence of P/V operations on \( s \) by named processes.
Process : P1 P2 P3 P4 P5 P1 P2
Operation : \( P \) P P P P V
( a ) Message buffers and message queues can be

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!