HW 2

advertisement
HW2 and Study material for Exam 1
1. For the tree program,
a. Identify constraints in the fault-span, constraints in the invariant, program actions
b. For each action, show that it fixes the corresponding predicate
c. For each action, show that it does not violate constraints in the fault-span
d. For each action, show that it does not violate previous constraints
2. For the fault-tolerant mutual exclusion algorithm based on Raymond, identify
a. Identify constraints in the fault-span, constraints in the invariant, program actions
b. For each new action, show that it fixes the corresponding predicate
c. For each new action, show that it does not violate constraints in the fault-span
d. For each new action, show that it does not violate previous constraints (including
constraints in fault-span)
3. Let ph denote perfectly synchronized physical clock. Let ph.e denote the physical timestamp of
event e based on this clock. Identify whether the following statements are true/false. If you say
false, give an example. If you say true, identify why
a. ph.e < ph.f  cl.e < cl.f
b. cl.e < cl.f  ph.e < ph.f
c. ph.e < ph.f  vc.e < vc.f
d. cl.e < cl.f  vc.e < vc.f
Additional questions for Exam 1 preparation. No need to turn in. But strongly recommended to solve.
Feel free to discuss on Piazza.
4. Given a program and a computation, identify whether the computation can be generated by
that program in no fairness/weak fairness/strong fairness.
5. Given a property, identify whether it is a safety, liveness, neither, both
6. Given two or more properties, identify whether their union, intersection, complement,
difference etc satisfy safety, liveness etc.
7. Consider problems such as: Identify prop1 and prop2 such that prop1 subset of prop2, prop1 is a
safety property but prop2 is not. Variation of problems like this
8. Given a set of processes with some messages, identify logical/vector clocks associated with
corresponding events
9. Same thing with respect to causal delivery of messages
10. Given logical clock/vector clock values of two or more events, identify whether they are related
causally (happened before)
11. *Why did we assume causal broadcast in our solution for causal delivery? Identify a solution for
causal delivery where messages are unicast. (Hint: This requires clocks that are matrices rather
than vectors. In other words, clock of process j is of the form: cl.j.k.l, where cl.j.k.l denotes the
knowledge j has about messages sent by k to l.
12. Prove properties of Lamport algorithm such as (1) If there are two requests with different
timestamps, process with lower timestamp will enter CS first, (2) If process j requests twice and
process k requests once at the same time then process k must enter CS before process j gets it
twice
13. For each mutual exclusion algorithm, what is the number of messages, delay, max throughput
etc.
14. For each mutual exclusion algorithm, identify whether they guarantee fairness, whether they
guarantee that processes enter CS in order of timestamps, etc.
Download