59.3k views
2 votes
3. Using the narrow staircase example from the beginning of this chapter, create a list of actions or tasks that could be implemented by the building manager that would allow people to use the staircase without risking a deadlock or starvation.

Here is the staircase exmaple from the book:

A deadlock is most easily described with an example that we return to throughout the chapter—a narrow staircase in a building. The staircase was built as a fire escape route, but people working in the building often take the stairs instead of waiting for the slow elevators. Traffic on the staircase moves well unless two people, traveling in opposite directions, need to pass on the stairs—there’s room for only one person on each step. There’s a landing at each floor that is wide enough for two people to share, but the stairs are not—they can be allocated to only one person at a time. In this example, the staircase is the system and the steps and landings are the resources. Problems occur when someone going up the stairs meets someone coming down, and each refuses to retreat to a wider place. This creates a deadlock, which is the subject of much of our discussion on process synchronization.Similarly, if two people on a landing try to pass each other but cannot do so because as one steps to the right, the other steps to the left, and vice versa, then they will continue moving but neither will ever move forward. This is called livelock .On the other hand, if a few patient people wait on the landing for a break in the opposing traffic, and that break never comes, they could wait there forever. That results in starvation , an extreme case of indefinite postponement, and is discussed at the end of this chapter.

1 Answer

7 votes

Final answer:

To avoid deadlock or starvation on a narrow staircase, the building manager can implement a traffic light system, assign a stairway monitor, and implement staggered work schedules.

Step-by-step explanation:

To avoid deadlock or starvation on a narrow staircase, the building manager can implement the following actions or tasks:

  1. Install a traffic light system: The traffic light system will control the flow of people on the staircase by indicating when it is safe for someone to use the stairs. When two people approach each other, the traffic light will turn red for one direction, allowing the other person to pass safely.
  2. Assign a stairway monitor: The building manager can designate a person to monitor the staircase and ensure that people follow the traffic rules. The monitor can guide and coordinate the movement of people, preventing deadlock or congestion.
  3. Implement staggered work schedules: By staggering the work schedules of the people in the building, the building manager can reduce the number of people using the staircase at the same time. This will help to alleviate congestion and reduce the chances of deadlock or starvation.

User Bao Huynh
by
8.5k points