hw2f04

advertisement

HOMEWORK 2

Due Date: October 19, 2004

1. Consider the diffusion-based algorithm for detecting deadlocks under the OR-request model. Modify the algorithm so that the initiator detecting a deadlock gets the list of processes that are involved in the deadlock.

2. A student came to my office with the following space-time diagram for Lamport’s distributed mutual exclusion algorithm. The student argued that the Site S2 can enter into Critical Section

(CS) at Tx (instead of Ty), even though: i.

S2 has not received a REPLY message from S1 at Tx. ii.

S2’s request is not at the top of S1’s request_queue at Tx.

Give me precise points to counter or accept the student’s argument. (If the answer is “Yes”, you should say why there would not be a problem in entering into CS without S1’s REPLY message and without S2’s request being at the top of S1’s queue. If the answer is “No”, you should explain which aspect of Lamport’s algorithm will prevent S2’s entry into CS at Tx).

What would be your arguments if the system follows Ricart-Agrawala’s algorithm instead of

Lamport’s?

(5, 1)

S1

S2 Tx Ty

S3

(3, 2)

(3, 2)

3. The delay in finding a deadlock using edge-chasing algorithm is supposedly O (N). Is that an upper bound or a lower bound? Explain your answer (may be with simple examples). What can be the lower bound on the number of messages to be exchanged (using the edge-chasing algorithm)?

4. In the class, we discussed that Sun Network File System (NFS) is stateless. It is difficult for a stateless server to handle concurrent write sharing. However, some of you gave examples of editors that do handle concurrent write sharing. We know that these editors do not work over a separate/proprietary shell (as you are implementing it in your current project). How do you think they may be working?

Also, can you think of few issues that need to be addressed for making a stateless server support replication?

5. Consider the Singhal system after a few critical section requests. When no system is requesting for access to critical section, the token will be idly circulating in the system. The reasoning behind this: the status vector in all the sites would have the value R for at least some entries.

Hence, whenever a site receives the token, it will forward it to another site, resulting in the idle circulation of token. What is your opinion about this?

6. We saw that the Chandy-Misra-Haas edge-chasing algorithm cannot detect a deadlock if the initiating process is not part of the cycle. For instance, we considered the following WFG where processes request for resources using the AND request model. (The 5 processes can be assumed to be executing in different sites). Assuming that P5 is the initiator of the deadlock detection algorithm, we saw that P5 cannot identify a deadlock. Can you modify the algorithm to make a process that is involved in a deadlock but is not part of a cycle, (such as P5) detecting the deadlock? (The modification should be general as much as possible and not tied to this example

WFG).

P1

P2

P3

P4

P5

7. Two students A and B put forward the following arguments to me regarding stateless servers.

Student A’s argument is the following:

Stateless servers cannot support server-initiated cache invalidation or concurrent writesharing policy. Without these mechanisms (server-initiated invalidation or concurrent write-sharing), it is difficult to support strict file consistency , i.e., ensure a read will return the latest written value.

Student B’s argument is the following:

Stateless servers can still use client-initiated cache validation. By forcing a client to check the validity before each data access, stateless servers can still provide strict file consistency. Though the full realization of the benefit will depend the validation enforcement on the client-side.

Whom do you think is correct? Why?

8. We saw that Suzuki-Kasami algorithm has an ordering problem. In this question, we assumed there are 4 sites in a distributed system following Suzuki-Kasami algorithm for mutual exclusion.

S2 has the token and is currently executing the critical section. (Assume that there were no prior/pending requests at this time). During this execution, S2 receives a request from S4 first and

S3 next. After completing its execution, S2 forwards the token to S3 (even though its was a later request) due to the way the algorithm is structured.

Can we overcome this anomaly by using time stamps?

 If the answer is yes, what type of time stamp would be needed: Lamport’s logical clock or vector clock? Also, you need to explain the changes to be made in the algorithm.

If the answer is no, you have to justify how time stamps cannot prevent this anomaly.

E.g., by giving an instance where time stamps do not solve the anomaly.

Can you also discuss how your answer would relate to Singhal’s algorithm? (e.g., type of clock or whether the time stamps won’t help, etc.)

9. Consider a distributed file system with the following features. Here, files (and directories) are grouped into volumes. The files are assigned a unique identifier that 2 tuples: <VolumeIdentifier,

FileIdentifier> (directories are considered as special files). Each volume is assumed to be stored in one disk or a file system. Name resolution is carried out by building a volume location table.

Files are composed of file blocks with a block size of 512 bytes. At the client side, a memory page is 8 Kbytes. However, files are cached and the cache is maintained in terms of file blocks.

With respect to the above distributed file system: a) What is the advantage of grouping files into volumes? b) What would be the effect of client caching a file in terms of memory pages (as compared to file blocks)?

Download