Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
mc0085 set 2 killer assignment spring 2012

mc0085 set 2 killer assignment spring 2012

Ratings: (0)|Views: 363|Likes:
Published by killer1

More info:

Published by: killer1 on May 29, 2012
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less





Spring 2012Master of Computer Application (MCA)
Semester VMC0085
Advanced Operating Systems (Distributed Systems)
4Credits (Book ID: B 0967)
Assignment Set
1. Describe the following:
A major issue in communication is the synchronization imposed on the communicatingprocesses by the communication primitives. There are two types of communicatingprimitives: Blocking Semantics and Non-Blocking Semantics.
Blocking Semantics:
A communication primitive is said to have blocking semantics ifits invocation blocks the execution of its invoker (for example in the case of send, thesender blocks until it receives an acknowledgement from the receiver.)
Non-blocking Semantics:
A communication primitive is said to have non-blockingsemantics if its invocation does not block the execution of its invoker.The synchronization imposed on the communicating processes basically depends onone of the two types of semantics used for the
Blocking PrimitivesBlocking Send Primitive:
In this case, after execution of the send statement, thesending process is blocked until it receives an acknowledgement from the receiver thatthe message has been received.
Non-Blocking Send Primitive:
In this case, after execution of the send statement, thesending process is allowed to proceed with its execution as soon as the message iscopied to the buffer.
Blocking Receive Primitive:
In this case, after execution of the receive statement, thereceiving process is blocked until it receives a message.
Non-Blocking Receive Primitive:
In this case, the receiving process proceeds with itsexecution after the execution of receive statement, which returns the control almostimmediately just after telling the kernel where the message buffer is.
Handling non-blocking receives
: The following are the two ways of doing this:
a test primitive is used by the receiver to check the buffer status
When a message is filled in the buffer, software interrupt is used to notify thereceiver. However, user level interrupts make programming difficult.
Handling blocking receives:
A timeout value may be used with a blocking receiveprimitive to prevent a receiving process from getting blocked indefinitely if the senderhas failed.
Synchronous Vs Asynchronous Communication
When both send and receive primitives of a communication between two processes useblocking semantics, the communication is said to be synchronous. If one or both of theprimitives is non-blocking, then the communication is said to be asynchronous.Synchronous communication is easy to implement. It contributes to the reliable deliveryof messages. Asynchronous communication limits concurrency and is prone tocommunication deadlocks
The transmission of messages from one process to another can be done by copying the
body of the message from the sender’s address space to the receiver’s address space.
In some cases, the receiving process may not be ready to receive the message but itwants the operating system to save that message for later reception. In such cases, the
operating system would rely on the receiver’s buffer space in which the transmitted
messages can be stored prior to receiving process executing specific code to receivethe message.The synchronous and asynchronous modes of communication correspond to the twoextremes of buffering: a null buffer, or no buffering, and a buffer with unboundedcapacity. Two other commonly used buffering strategies are single-message and finite-bound, or multiple message buffers. These four types of buffering strategies are givenbelow:
No buffering:
In this case, message remains in the sender’s address space until the
receiver executes the corresponding receive.
Single message buffer:
A buffer to hold a single message at the receiver side isused. It is used for implementing synchronous communication because in this case anapplication can have only one outstanding message at any given time.
Unbounded - Capacity buffer:
Convenient to support asynchronous communication.However, it is impossible to support unbounded buffer.
Finite-Bound Buffer:
Used for supporting asynchronous communication.Buffer overflow can be handled in one of the following ways:
Unsuccessful communication:
send returns an error message to the sendingprocess, indicating that the message could not be delivered to the receiver because thebuffer is full.
Flow-controlled communication:
The sender is blocked until the receiver acceptssome messages. This violates the semantics of asynchronous send. This will also resultin communication deadlock.
A message data should be meaningful to the receiving process. This implies ideally thatthe structure of the program should be preserved while they are being transmitted fromthe address space of the sending process to the address space of the receivingprocess. It is not possible in heterogeneous systems in which the sending and receivingprocesses are on computers of different architectures. Even in homogeneous systems,it is very difficult to achieve this goal mainly because of two reasons:1. An absolute pointer value has no meaning (more on this when we talk about RPC).For example, a pointer to a tree or linked list. So, proper encoding mechanisms shouldbe adopted to pass such objects.2. Different program objects, such as integers, long integers, short integers, andcharacter strings occupy different storage space. So, from the encoding of theseobjects, the receiver should be able to identify the type and size of the objects.One of the following two representations may be used for the encoding and decoding ofa message data:1.
Tagged representation:
The type of each program object as well as its value isencoded in the message. In this method, it is a simple matter for the receiving processto check the type of each program object in the message because of the self-describingnature of the coded data format.2.
Untagged representation:
The message contains only program objects, noinformation is included in the message about the type of each program object. In thismethod, the receiving object should have a prior knowledge of how to decode thereceived data because the coded data format is not self-describing.
The untagged representations used in SUN’s XDR format and tagged representation is
used in Mach distributed operating system.
2. Describe the following:
Communication protocols for RPC
Server BindingAnswer:
Communication Protocol for RPCs
Different systems developed on the basis of remote procedure calls have different IPCrequirements. Based on the needs of different systems, several communicationprotocols have been proposes for RPCs. A brief description of these protocols is givenbelow:i)
The Request Protocol:
Also known as the R protocol. It is useful for RPCs in whichthe called procedure has nothing to return and the client does not require confirmationfor the procedure having been executed. An RPC protocol that uses R protocol is alsocalled asynchronous RPC. For asynchronous RPC, the RPCRuntime does not takeresponsibility for retrying a request in case of communication failure. So, if an unreliabletransport protocol such as UDP is used, then request messages could be lost.Asynchronous RPCs with unreliable transport protocols are generally useful for

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->