Deadlock and Starvation Conditions Essay Example

Paper Type:  Essay
Pages:  5
Wordcount:  1286 Words
Date:  2022-08-23

1. For each of these conditions- deadlock, race, and starvation-give at least two "real life" examples (not related to a computer system environment) of each of these concepts. Then give your own opinion on how each of these six conditions can be resolved

Deadlock- Think of a newly used route with very many pedestrians crossing. It is expected that you stop before crossing it when there is any pedestrian waiting. So you continue driving and spot a pedestrian on the queue waiting (Wu & MengChu Zhou, 2001). You have the knowledge that you should stop but you do not stop because you have no idea whether the pedestrian is willing to cross or not. You finally stop from crossing the road but at the same time, the pedestrian does not cross. The pedestrian stops because he has no knowledge whether you have given him the way or not. under this condition, there is a deadlock when both sides observe the rules thus there would be no obscurity.

Trust banner

Is your time best spent reading someone else’s essay? Get a 100% original essay FROM A CERTIFIED WRITER!

Starvation-When you are working in a big company and daily there is a rush hour during lunchtime. Every worker has the desire to be in the food line for the first time. You have an office on the uppermost floor and for you to be in the lobby, you must use the lift. You have to call the lift and wait for it. The waiting time is infinite because other workers on the lower floors are making the call for the same lift, therefore, it cannot reach the upper floor where you are. When it reaches, you shall have gone back to your office and taken in some flavors that were not been used from the previous day.

Race condition- Suppose you have a tank of fishes; you ensure that you feed them on daily basis after school. You have no knowledge that your younger brother has also been feeding the fishes when from school in your absence. He also feeds fishes on daily basis and after some weeks, all the fishes died due to overfeeding. Poor planning of feeding fishes is in a race condition. You did not have the knowledge whether fishes have been fed or not or if both of you have fed the fishes.

2. Given the ice cream sundae example from the beginning of this chapter, identify which elements of the deadlock represent the four necessary conditions for this deadlock.

For example, when the ice cream store is being locked and you have the opportunity to find one available ice cream sundae and the spoon is grabbed by the next customer on the line. If there is no any other additional available ice cream sundae and spoon and there is no one who is ready to give up, there is a deadlock. It means that there are several conditions that cause deadlock. Under this condition, the element of the deadlock representing four necessary conditions is when both the two give up and do not want to take the ice cream. There will be a deadlock because none of them will know whether the other party has given up.

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.

It is easy to describe a deadlock using an example. It is necessary to build arrow staircase in the building to be used as fire escape opening. The people that are using the building should use the stairs rather than waiting for the lift which they are not sure will come. It will be essential for people to move in pairs while using the stairs but in the opposite direction because there is only one way for each person on each step. It is also necessary to build a wide landing on every floor which can allow two people to occupy and the stair can only be accommodated by a single person at a time. For this case, the staircases the system while steps and landings are the resources (Wu & MengChu Zhou, 2001). There is an issue when two people are moving in the opposite direction in the stairs and there is nobody who accepts to go back. Under this condition, there is a deadlock condition. At the same time, when two people on the landing are attempting to pass each other but experiencing some difficulties because there are only two steps one to the left and the other to the right. These people will just move up and down but no one would get a way to move forward. This condition is called livelock. On the contrary, when there are few patients who are waiting on the landing for lunch in the opposing traffic and lunch takes very many hours to come, they are likely to go back to their wards without eating. This condition is starvation.

  • Building a wide staircase
  • Installing lifts
  • Building a wide landing
  • Have multiple stairs in each section of the building

4. If a deadlock occurs at a combination of downtown intersections, as shown in the figure below, explain in detail how you would identify that a deadlock has occurred, how you would resolve it after it happens, and how you would act to prevent it from happening again.

Deadlock can be identified when there is only one way and it is difficult to move in opposite direction This is a situation where the road is the only resource which is held in a non-sharable mode (Wu & MengChu Zhou, 2001). The dreadlock condition is also identified when there is wait and hold. It happens when one driver is waiting for another one to pass before him. He could have the option to cross the road or to stop the other cars on the highway to pass before joining the main road while the other is waiting. The driver has the knowledge that he should stop but cannot do so because he has no idea whether the other driver on the highway is willing to cross or not. The problem can be resolved through the expansion of the road which allows two vehicles to move in the opposite direction. It can also be solved through the creation of traffic lights which give way to vehicles in a given rout to pass and stopping others.

5. Explain how you would design and implement a mechanism to allow the operating system to detect which, if any, processes are starving.

Creating an operating system that detect if processes are starving. it is important to design and implement a linked list of waiting and holding processes which are waiting for a resource. Then periodically run a function through the use of interrupts which checks the list if there is a process which waits for a resource (Duato & Ni, 2003). It is also appropriate to have a variable for each process which must be increased at any time. When it reaches a given point, it can be understood that the starting point has been reached. It is, therefore, possible to identify when there is either higher or lower priority. A Higher priority is a condition when there is resource allocation which prevents the lower priority process from getting the demanded resources. The design of the operating system which allows the detection of low or high resources in the system would help in the identification of starving processes.

References

Duato, J., Yalamanchili, S., & Ni, L. (2003). Deadlock, Livelock, and Starvation. Interconnection Networks, 83-138. doi:10.1016/b978-155860852-8/50006-7

Wu, N., & MengChu Zhou. (2001). Avoiding deadlock and reducing starvation and blocking in automated manufacturing systems. IEEE Transactions on Robotics and Automation, 17(5), 658-669. doi:10.1109/70.964666

Cite this page

Deadlock and Starvation Conditions Essay Example. (2022, Aug 23). Retrieved from https://proessays.net/essays/deadlock-and-starvation-conditions-essay-example

logo_disclaimer
Free essays can be submitted by anyone,

so we do not vouch for their quality

Want a quality guarantee?
Order from one of our vetted writers instead

If you are the original author of this essay and no longer wish to have it published on the ProEssays website, please click below to request its removal:

didn't find image

Liked this essay sample but need an original one?

Hire a professional with VAST experience and 25% off!

24/7 online support

NO plagiarism