DSCCquestionsandanswers Unit 1 and 2
DSCCquestionsandanswers Unit 1 and 2
The client process calls the client stub with parameters, and its execution
is suspended until the call is completed.
The parameters are then translated into machine-independent form by
marshalling through client stub. Then the message is prepared which
contain the representation of the parameters.
To find the identity of the site the client stub intercommunicate with name
server at which remote procedure exists.
Using blocking protocol the client stub sends the message to the site
where remote procedure call exists. This step halt the client stub until it
gets a reply.
The server site receives the message sent from the client side and
converts it into machine specific format.
Now server stub executes a call on the server procedure along with the
parameters, and the server stub is discontinued till the procedure gets
completed.
The server procedure returns the generated results to the server stub,
and the results get converted into machine-independent format at server
stub and create a message containing the results.
The result message is sent to the client stub which is converted back into
machine specific format suitable for the client stub.
At last client, stub returns the results to the client process.
Definition of RMI
Remote Method Invocation (RMI) is similar to RPC but is language specific and
a feature of java. A thread is permitted to call the method on a remote object.
To maintain the transparency on the client and server side, it implements
remote object using stubs and skeletons. The stub resides with the client
and for the remote object it behaves as a proxy.
When a client calls a remote method, the stub for the remote method is called.
The client stub is accountable for creating and sending the parcel containing
the name of a method and the marshalled parameters, and the skeleton is
responsible for receiving the parcel.
The skeleton unmarshals parameters and invokes the desired method on the
server. The skeleton marshals the given value (or exceptions) with the parcel
and sends it to client stub. The stub reassembles the return parcel and sends
it to the client.
In Java, the parameters are passed to methods and returned in the form of
reference. This could be troublesome for RMI service since not all objects are
possibly remote methods. So, it must determine which could be passed as
reference and which could not.
Java uses process named as serialisation where the objects are passed as
value. The remote object is localised by pass by value. It can also pass an
object by reference through passing a remote reference to the object along
with the URL of the stub class. Pass by reference restricts a stub for the
remote object.
Minicomputer Model
2.Workstation Model
A distributed computing system based on the workstation model consists of
several workstations interconnected by a communication network.
An organization may have several workstations located throughout an
infrastructure were each workstation is equipped with its own disk & serves as a
single-user computer.
In such an environment,at any one time a significant proportion of the
workstations are idle which results in the waste of large amounts of CPU time.
Therefore,the idea of the workstation model is to interconnect all these
workstations by a high-speed LAN so that idle workstations may be used to
process jobs of users who are logged onto other workstations & do not have
sufficient processing power at their own workstations to get their jobs processed
efficiently.
3.Workstation–Server Model
The workstation model is a network of personal workstations having its own disk
& a local file system.
A workstation with its own local disk is usually called a diskful workstation & a
workstation without a local disk is called a diskless workstation.Diskless
workstations have become more popular in network environments than diskful
workstations,making the workstation-server model more popular than the
workstation model for building distributed computing systems.
A distributed computing system based on the workstation-server model consists
of a few minicomputers & several workstations interconnected by a
communication network.
In this model,a user logs onto a workstation called his or her home
workstation.Normal computation activities required by the user's processes are
performed at the user's home workstation,but requests for services provided by
special servers are sent to a server providing that type of service that performs
the user's requested activity & returns the result of request processing to the
user's workstation.
Therefore,in this model,the user's processes need not migrated to the server
machines for getting the work done by those machines.
Example:The V-System.
4.Processor–Pool Model:
The processor-pool model is based on the observation that most of the time a
user does not need any computing power but once in a while the user may need
a very large amount of computing power for a short time.
Therefore,unlike the workstation-server model in which a processor is allocated
to each user,in processor-pool model the processors are pooled together to be
shared by the users as needed.
The pool of processors consists of a large number of microcomputers &
minicomputers attached to the network.
Each processor in the pool has its own memory to load & run a system program
or an application program of the distributed computing system.
In this model no home machine is present & the user does not log onto any
machine.
This model has better utilization of processing power & greater flexibility.
Example:Amoeba & the Cambridge Distributed Computing System.
5.Hybrid Model:
process. Message has a predefined structure and message passing uses two system
In this calls, the sender and receiver processes address each other by names. Mode
of communication between two process can take place through two methods
1) Direct Addressing
2) Indirect Addressing
Direct Addressing:
In this type that two processes need to name other to communicate. This become
Example
send(B, message);
Receive(A, message);
By message passing a link is established between A and B. Here the receiver knows
diagram:
Indirect addressing:
In this message send and receive from a mailbox. A mailbox can be abstractly
viewed as an object into which messages may be placed and from which messages
may be removed by processes. The sender and receiver processes should share a
mailbox to communicate.
- One to One link: one sender wants to communicate with one receiver. Then single
link is established.
receiver.Example in client server system, there are many crying processes and one
- One to Many link: One sender wants to communicate with multiple receiver, that
is to broadcast message.
In this algorithm it is assumed that all the processes in the system are organized
in a logical ring. The figure blow describes the structure.
The ring positions may be allocated in numerical order of network addresses and
is unidirectional in the sense that all messages are passed only in clockwise or
anti-clockwise direction.
When a process sends a request message to current coordinator and does not
receive a reply within a fixed timeout, it assumes the coordinator has crashed. It
then initializes the ring and process Pi is given a token.
The token circulates around the ring. It is passed from process k to k+1 in point
to point messages. When a process acquires the token from its neighbor it
checks to see if it is attempting to enter a critical region. If so the process enters
the region does all the execution and leaves the region. After it has exited it
passes the token along the ring. It is not permitted to enter a second critical
region using the same token.
If a process is handed the token by its neighbor and is not interested in entering
a critical region it just passes along. When no processes want to enter any critical
regions the token just circulates at high speed around the ring.
Only one process has the token at any instant so only one process can actually
be in a critical region. Since the token circulates among the process in a well-
defined order, starvation cannot occur.
Once a process decides it wants to enter a critical region, at worst it will have to
wait for every other process to enter and leave one critical region.
The disadvantage is that if the token is lost it must be regenerated. But the
detection of lost token is difficult. If the token is not received for a long time it
might not be lost but is in use.
Q.2. Explain Mutual Exclusion Centralized Approach, Distributed Approach and Token Ring Algorithm
Distributed Approach
When a process wants to enter CS, it sends a message to all processes.
Actions by various processes:
1.If Pr is in CS, it queues message
2.If Pr is not in CS, but waiting for its turn, it checks TS of incoming message. If TS of its
request is lower, it sends ok else queues the message & defers reply
3.If Pr not interested in CS, sends a reply
Drawbacks:
Process failure
Lost token
Election of a central coordinator process from among currently running processes in such a
manner that only one coordinator is elected
Assumptions:
1.Each process has a unique priority no.
2.The process having highest priority no . is elected
3.On recovery a failed process can take proper action to rejoin the set of active processes
Bully Algorithm
A process Pi sends a request message to the coordinator & does not receive a reply within a
specified period
Pi initiates “election” message to every process with a higher priority
If Pi does not receive any response then, it assumes that its priority is highest & sends a
“coordinator” message to all other processes
Else
If Pi receives a response for its election message, it means that some other process has highest
priority & waits for result.
Bully Algorithm
1.P5 is coordinator and P5 crashes
4.P4 sends ‘Alive message to P3 and will take over election activity. P5 cannot respond
7.P4 wins the election and sends coordinator message to P1, P2 and P3 but P2 is down
8.P2 recovers and initiates an election by sending election message to P3, P4 and P5. P4 wins the
election
Strict Consistency
Sequential Consistency
PRAM Consistency