project4 - COP5615 Operating System Principles Fall 2007...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
COP5615 Operating System Principles Fall 2007 Project 4 Date Assigned: Oct. 25, 2007 Date Due: Nov. 8, 2007 (11:59 pm) for LOCAL students (Sections: 1092, 9333) Nov. 12, 2007 (11:59 pm) for EDGE students (Sections: 5667, 8170, 8404) Introduction: In this project, we will implement the token-based distributed mutual exclusion algorithm with a logical ring topology as discussed in class. Processes in this algorithm form a logical ring where a token circulates in the ring. A process is allowed to execute its critical section only if it possesses the token. When the process has finished the critical section (if any), it passes the token to the successor node in the ring. The logical ring structure is attractive because it is simple, fair, and deadlock-free. The ring structure you will implement is a dynamic ring, which means that joining to the ring or leaving from the ring can happen at any time. Both multicast and unicast communications will be used to initialize the ring and circulate the token within this dynamic ring. Each process will know the IP addresses and port numbers of its own successor and predecessor, and they logically point to their successor and predecessor with the IP address and port number using the UDP protocol. That is, they will pass the token to their successor by using the IP address and the port number of the successor. They also need to point to predecessor when creating a new connection. Detailed steps for a new node to join or leave the ring are shown later in “Detailed description of process behavior” part. Only the process with the token executes the critical section and releases the token after the critical section but without the token main thread in the processes will be block to wait for the circulation of the token. One direction of token passing P4 P3 P2 P1 Logical connection of the ring
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The structure of the process Process on different machine Thread 2 Listen UDP communication channel Thread 3 Listen Multicast communication channel Thread 1 Main thread to execute the critical section . Problem Details : The processes in the ring run on different machines in the same multicast group. Each process contains three logical components represented as threads. The main thread is a loop that makes request to enter the critical section, blocks to wait for the token, enters the critical section and release the token when it is done. Thus the main thread needs to interact (through shared object) with the token passing thread, the second thread in the diagram. This thread receives the token from the predecessor and passes it down to the successor using a UDP communication channel. It is required to check if the main thread needs to execute the critical section before sending the token to the successor, and if the main thread is blocked for the token, then it wakes up the main thread to execute the critical section. Upon the completion of the critical section, the main thread informs the token passing thread to continue passing
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

project4 - COP5615 Operating System Principles Fall 2007...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online