CS4202: Distributed System by v143d0S9

VIEWS: 818 PAGES: 4

									                            CS6223: Distributed System
                         Middle Semester Test (150/150)

                             Select 2 out of the 3 questions


Question 1 (75/150) Multiple choice questions (each 5/150):

(1) A distributed system is
(a) a parallel system with shared memory;
(b) a collection of independent computers that appears to its users as a single coherent system.
(c) a system that has physically distributed memory and a logically shared memory;
(d) a system in which each processor must have the same architecture.

(2) In distributed systems, there is no global clock because
(a) there is no need to have it for distributed applications;
(b) it is too easy to accurately synchronize all the local clocks in DS;
(c) it is a direct consequence of the fact that the only communication is message passing through
a network;
(d) none of the above.

(3) Network operating system
(a) is used for managing multiprocessors and homogeneous multicomputers;
(b) is used mainly to provide single system image of a distributed system;
(c) is used for heterogeneous mutlicomputer systems;
(d) must have middleware to share resources across the networked computer system.

(4) Location transparency
(a) allows the movement of resources and clients within a system without affecting the operations
of users or programs;
(b) enables local and remote resources to be accessed using identical operations;
(c) hides whether a resource is in memory or on disk;
(d) enables resources to be accessed without knowledge of their location.

(5) Regarding to a thread,
(a) multiple threads in a process may share the same address space;
(b) a complete independent address space needs to be allocated;
(c) when it (thread) is blocked, all the threads in the same process must also be blocked;
(d) none of the above.

(6) In transient communication,
(a) a message being transmitted is stored by the communication system as long as it takes to
deliver it to the receiver;
(b) a message is stored by communication system only as long as the sending and receiving
applications are executing;
(c) a sender is blocked until its message is stored in a local buffer at receiving host;
(d) none of the above.
(7) In synchronous communication,
(a) A sender continues immediately after it has submitted its message for transmission;
(b) The sender is blocked until its message is stored in a local buffer at receiving host, or to the
receiver;
(c) Timing plays a crucial role. The two successive messages may have a temporal relationship
such as those in video and audio streams in multimedia applications;
(d) A message that has been submitted for transmission is stored by the communication system as
long as it takes to deliver it to the receiver.

(8) Regarding to idempotent operation,
(a) appending data to a file is an idempotent operation;
(b) adding an non-zero number to a bank account is not an idempotent operation;
(c) adding one element to a set is not an idempotent operation;
(d) none of the above.

(9) In making remote procedure call (RPC),
(a) the parameters can be passed by reference and pointer values;
(b) the parameters can only be passed by value;
(c) the parameters can be any objects;
(d) the parameters can only be object references.

(10) In making remote method invocation (RMI),
(a) the parameters can only be passed by value;
(b) the parameters can be object references;
(c) only remote objects can be used as parameters;
(d) only local objects can be used as parameters.

(11) An identifier
(a) may refer to more than one entity;
(b) may be re-used to refer to another entity;
(c) may refer to an entity that is referred by another identifier;
(d) none of the above.

(12) For clock synchronization,
(a) there must be an external authoritative time source for internal synchronization;
(b) internally synchronized clocks should also be externally synchronized;
(c) if a set of processes P is synchronized externally within a bound D, it is also internally
synchronized with the same bound D;
(d) none of the above.

(13) Regarding to Lamport causal ordering, i.e., the happen-before ordering ->,
(a) if events x and y are in process P1 and P2 respectively, then either x->y or y->x;
(b) the logical clock based on Lamport ordering must have a close relationship with physical
clock;
(c) totally ordered logical clocks based on Lamport ordering can be obtained by taking process id
into consideration;
(d) none of the above.
(14) When passing an object (reference) as parameter in Java RMI,
(a) Both local object and remote project are passed by reference (the references are copied);
(b) The local object is passed by value (the object is copied), while the remote object is passed by
reference;
(c) The local object is passed by reference, while remote object is passed by value (the object is
copied);
(d) none of the above.

(15) Achieving mutual exclusion,
(a) is only required in distributed systems, and is never needed in single-processor systems;
(b) is primarily used in distributed systems to enhance the performance;
(c) is necessary for a process to read or write certain shared data;
(d) none of the above.

Question 2 (75/150)

2.1 (15/150) Scalability can be achieved by applying different techniques. Described briefly these
techniques.

2.2 (30/150) Describe briefly the socket programming in client-server model for TCP (e.g., using
flowchart or other figure for client and server part and their interaction), and answer the following
questions briefly:
(a) Why the server needs to establish another connection with client after receiving the incoming
request from a client?
(b) Why it is desirable to create a new thread for a new request?

2.3 (30/150) How do the entries in the following figure change if we assume that the algorithms
for mutual exclusion can be implemented on a LAN that supports hardware broadcasts (in which
sending a point-to-point message is as expensive as doing a broadcast)?

              Messages per       Delay before entry
Algorithm                                           Problems
              entry/exit         (in message times)
Centralized   3                  2                   Coordinator crash
                                                     Crash of any
Distributed   2(n–1)             2(n–1)
                                                     process
                                                     Lost token,
Token ring    1 to              0 to n – 1
                                                     process crash

    A comparison of three mutual exclusion algorithms.

Question 3 (75/150)

3.1 (25/150)
(a) (15/150) Why are transport-level communication services often inappropriate for building
distributed applications?

(b) (10/150) What are the major differences (in semantics) between making an RPC and making
local procedure call?
3.2 (50/150) In a group of sites (computers), there are a master m and two slaves s1 and s2. At
6:00:00 (at m’s clock), the master sends a request message containing its current time (i.e.,
6:00:00) to s1 and s2 respectively. The master m receives reply message rm1 from s1, and rm2
from s2 at 6:00:15 and 6:00:31 (m’s clock), respectively. The rm1 contains the current time
5:59:35 at s1 (and rm2 contains the current time 6:00:10 at s2) when the reply message is sent.
Assume that the time interval between the time s1 (also s2) receives the request message from m
and the time it sends reply message to m is too small and can be ignored.

    (a) Using Cristian algorithm at master site m, calculate the current time values (when the
        reply message is received by m) in s1 and s2 respectively. If it is known that the
        minimum time to transmit a message from m to s1 (or s2) is 5 second (i.e., 0:00:05), what
        is the accuracy of the synchronization?
    (b) Combining Cristian’s algorithm, apply Berkeley algorithm to internally synchronize the
    clocks in m, s1 and s2, that is, to get an average value of the three clocks. Show the process of
    the synchronization of all the three clocks.

								
To top