| |
CEG 730 Distributed Computing Principles
Fall 2009// Final Exam // 120 minutes // 100 points
Prabhaker Mateti
|
This is a closed book, closed notes exam. Do not give or
take help during the exam. Turn in your answers using the
command:
~ceg73000/bin/turnin FI answers.txt
- (12*5 points) In the following, it is possible to write
between 5 to 10 sentences each, and yet receive full score.
- In the context of token-passing algorithms, what is a "token"?
- Token-passing algorithms were discussed under the heading
of asynchronous message passing. Is it because token-passing
does not make sense under synchronous message passing? Discuss.
- Construct the ssend(pid, msg) and srecv(pid, msg) primitives of
synchronous message passing from asend(pid, msg) and arecv(pid,
msg) primitives of asynchronous message passing.
- Explain the Satisfaction Rule for Synchronous Communication.
- The happened before relation, as discussed,
requires a logical clock for every process. But a typical
machine (node) in a distributed system runs several
processes. Is it sufficient to maintain a logical clock per
node that is shared by all processes running on that
node? Show by construction or discuss why this does not work.
- In the context of distributed semaphore implementation,
discuss "fully acknowledged" messages.
- Can any solution to the distributed mutual exclusion
problem be thought of as a solution to the problem of
implementing semaphores in a distributed system, and vice
versa? True/False? Discuss.
- A binary "tree" is here given as a collection of its node
contents: (1, 2, 3), (2, 0, 3), (3, 2, 4), (4, 2, 1). Each
node contents is a triplet of (info-integer, left-link,
right-link). The node with info integer 1 is the root. Null
links are 0. Marshal/serialize the given binary tree.
- Reconstruct the binary "tree" serialized below. List each
node as a triplet of (info-integer, left-link, right-link),
as usual. The first digit in the sequence is the offset of
the root node.
marshaled sequence: 2 1 0 5 2 7 3 0 A 4 2 5 0
offsets in hex: 1 2 3 4 5 6 7 8 9 A B C D
- Does the precondition and statement {x ≥ 4 } < x := x
- 4 > interfere with the triple
{x ≥ 10} < x := x
+ 5 > {x ≥ 12}.
- Using the technique of weakened assertions, prove that {x =
0} S {x = 0} is a theorem, where S is var x := 0; co <x :=
x+2> || <x := x+3> || <x := x - 5> oc
- Explain, with an example, the map/reduce idea behind
Hadoop.
- (10+20+10 points) Given a large (in the zillions) bag B of
integers, and a specific integer x, compute how many of B's
integers are (i) greater than x, (ii) equal to x, and (iii) less
than x. Two solutions, one in CSP and another in C-Linda are to
be developed. It is not required that both use the same "idea."
Present your solutions with full explanations.
- As usual, (i) we wish to maximize concurrency, (ii) we
prefer a symmetric solution, (iii) we rate correctness much
higher than efficiency, and cannot tolerate (iv) deadlocks or
(v) livelocks. Defend why for each of these five.
- For C-Linda, assume that the tuple space already contains
the bag of integers < "B", n>, the size of
this bag < "BSZ", bsz>, and
< "x", x>. You lose 5 points for each use
of inp or rdp. Choose a number of processes
that maximizes concurrency. At the end, we expect to see
three tuples: < "greater", g >, < "equal", e >, and < "lesser", l >.
- For CSP, the bag is generated by process B whose structure
is
B :: *[ ... --> P!m ]. Assume that the
first two numbers output are bsz and x; the rest are integers
of B. Develop the process P and appropriately chosen other
processes, if any.
Copyright
© 2009
Prabhaker
Mateti •
November 16, 2009