DFG’s Token Algorithm
N processes
* ordered in logical ring and number from 0 to n-1.
* Token can only be sent clockwise in the ring.
* Work can be sent from any process to any process.
* each is white or black
* all processes may send/receive messages with work to another process
* only idle processes may send the token
One token
* white or black
DFG Initially
DFG All processes
Upon receiving a message
* Becomes active until work completed
Work completed; nothing to receive
* Becomes idle
When sending a message
* Changes own colour to black
When sending a token
* Changes own colour to white
DFG Process 0
Idle and has token: start termination detection
* Changes own colour to white
* Changes token colour to white
* Sends token to process (N-1)
Receives token from process 1
* Process 0 white and token white
Safe to terminate
* Process 0 black or token black
Wait until idle and then start termination detection again
DFG Worker Processes
Weight Throwing
Spanning Tree