479 views
1 votes
1 votes
A single-lane bridge connects the two Vermont villages of North Tunbridge and South Tunbridge. Farmers in the two villages use this bridge to deliver their produce to the neighboring town. The bridge can become deadlocked if a northbound and a southbound farmer get on the bridge at the same time. (Vermont farmers are stubborn and are unable to back up.) Using semaphores and/or mutex lock design an algorithm in pseudo code that prevents deadlock. Initially, do not be concerned about starvation (the situation in which northbound farmers prevent southbound farmers from using the bridge, or vice versa).

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
0 answers
2
0 votes
0 votes
0 answers
4
akash.dinkar12 asked Mar 20, 2019
348 views
Suppose that a system is in an unsafe state. Show that it is possible for the processes to complete their execution without entering a deadlocked state.