Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do {
- flag[i] = true
- turn = j
- while(flag[j] == true && turn == j){};
- #enter critical section
- flag[i] = false
- #remainder
- } while (true);
- do {
- #push i into process queue
- queue.push i
- #busy wait until i is first
- while(queue.first != i){};
- #enter critical section
- #remove i from the queue and let the next process begin
- queue.pop
- #remainder
- } while (true);
Add Comment
Please, Sign In to add comment