answersLogoWhite

0


Best Answer

while(1) { // thread i (0 <= i < n)

for (j=1 ; j<n ; j++) {

flag[i]=j;

last[j]=i;

for (k=0 ; k<n ; k++) {

if (k==i) continue;

while (flag[k]>=flag[i] && last[j]==i) {

sleep(random());

}

}

}

// critical section

...

// end of critical section

flag[i]=0;

// not critical section

...

// end of not critical section

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Dekker algorithm version5 for n-process
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the Difference between Peterson's algorithm and Dekker's algorithm?

Dekker algorithm has much more complex code with higher efficiency, while Peterson has simpler code. Imran Dekker algorithm has also the disadvantage of being not expendable (maximum 2 processes mutual exclusion, while Peterson can be extended for more then 2 processes. more info here: http://en.wikipedia.org/wiki/Peterson%27s_algorithm#The_Algorithm_for_more_then_2_processes


Does Peterson algorithm satisfy progress?

Yes Petersons algo satisfies Mutual exclusion, Progress and bonded waiting and is more efficient than Dekker's algo.


Where can you get a tamagotchi version5?

* amazon.com * Walmart * Target * Toys R us


What is the birth name of Dekker Dreyer?

Dekker Dreyer's birth name is Ryan Dekker Dreyer.


What is the birth name of Albert Dekker?

Albert Dekker's birth name is Albert Van Dekker.


What is the birth name of Fiet Dekker?

Fiet Dekker's birth name is Sophia Christina Dekker.


How tall is Albert Dekker?

Albert Dekker is 6'.


When was Chris Dekker born?

Chris Dekker was born in 1945.


When was Sybilla Dekker born?

Sybilla Dekker was born in 1942.


When was Cees Dekker born?

Cees Dekker was born in 1959.


When was Mark Dekker born?

Mark Dekker was born in 1969.


When was Dekker Curry born?

Dekker Curry was born in 1966.