0
16kviews
Short Note on: Token ring algorithm.

This question appears in Mumbai University > Parallel And Distributed System subject

Marks: 5 M

Year: May 12

1 Answer
1
1.9kviews

Token ring algorithm:

enter image description here

  • In this algorithm it is assumed that all the processes in the system are organized in a logical ring. The figure blow describes the structure.
  • The ring positions may be allocated in numerical order of network addresses and is unidirectional in the sense that all messages are passed only in clockwise or anti-clockwise direction.
  • When a process sends a request message to current coordinator and does not receive a reply within a fixed timeout, it assumes the coordinator has crashed. It then initializes the ring and process Pi is given a token.
  • The token circulates around the ring. It is passed from process k to k+1 in point to point messages. When a process acquires the token from its neighbor it checks to see if it is attempting to enter a critical region. If so the process enters the region does all the execution and leaves the region. After it has exited it passes the token along the ring. It is not permitted to enter a second critical region using the same token.
  • If a process is handed the token by its neighbor and is not interested in entering a critical region it just passes along. When no processes want to enter any critical regions the token just circulates at high speed around the ring.
  • Only one process has the token at any instant so only one process can actually be in a critical region. Since the token circulates among the process in a well-defined order, starvation cannot occur.
  • Once a process decides it wants to enter a critical region, at worst it will have to wait for every other process to enter and leave one critical region.
  • The disadvantage is that if the token is lost it must be regenerated. But the detection of lost token is difficult. If the token is not received for a long time it might not be lost but is in use.
Please log in to add an answer.