Learning Center
Plans & pricing Sign in
Sign Out



									M. Tech. in Computer Engineering Advanced Operating System Assignment 4
February 16, 2007


Theory Questions
1. Give an analogy between messages and semaphores. Why are semaphores more efficient than message passing? 2. What is the difference between a port and a message queue? When are blocking receives useful? What is the advantage of a blocking send? 3. Show a deadlock using semaphores. Give the program for each process. 4. What is the difference between ignoring a signal and blocking it? 5. Consider a statement, ” Any synchronization problem that can be solved with semaphores can be solved with messages, and vice versa”? Is this statement true or false? Explain the reasoning you used to come up with your answer. 6. Broadcasting a message can be implemented by sending a copy of of the message to each destination. This can be very expensive in use of memory, particularly as the size of messages, and the number of of destinations grow. Suggest an optimization. 7. Discuss the respective advantages of having one system wide buffer for all messages, one buffer per destination process, or one buffer per message stream, when using asynchronous message passing. 8. What is the essential difference between a monitor and an object. 9. Instead of blocking, a monitor could return a message saying ’busy-tryagain later’. Discuss the implementation of this.

10. Devise a protocol which would prevent a reader blocking on an empty pipe.


11. Suggest how you would implement a peek() function for pipes. This looks at the contents of the pipe, but does not remove it. 12. Devise a protocol by which a writer to a pipe could communicate the length of a message to a reader.


To top