- #1
whitehorsey
- 192
- 0
1. Is mutual exclusion, progress, and bounded waiting satisfied in this code?
Code: Two process solution to the critical section problem
For this problem, you can decide any case you want whether the processes go one after the other, execute two lines at once then switch to the other process, etc.
3. This is what I got:
Looking at this code it looks like it will never leave the while loop and hit the critical section so no it does not satisfy mutual exclusion.
Progress can only be made if you hit the critical section since it keeps going around in the while loop then no.
Lastly bounded waiting there is no time limit to enter the critical section? This one I'm not really sure about.
Code: Two process solution to the critical section problem
For this problem, you can decide any case you want whether the processes go one after the other, execute two lines at once then switch to the other process, etc.
3. This is what I got:
Looking at this code it looks like it will never leave the while loop and hit the critical section so no it does not satisfy mutual exclusion.
Progress can only be made if you hit the critical section since it keeps going around in the while loop then no.
Lastly bounded waiting there is no time limit to enter the critical section? This one I'm not really sure about.