Ask Question
19 November, 03:42

4 [3.7] In a block/wake up mechanism, a process blocks itself to wait for an event to occur. Another process must detect that the event has occurred and wake up the blocked process. It is possible for a process to block itself to wait for an event that will never occur. a Can the operating system detect that a blocked process is waiting for an event that will never occur.

a. Can the operating system detect that a blocked process is waiting for an event that will never occur?

b. What reasonable safeguards might be built into an operating system to prevent processes from waiting indefinitely for an event?

+2
Answers (1)
  1. 19 November, 06:03
    0
    a) Yes Operating System can detect that a blocked process is waiting for an event that will never occur.

    b) Operating System can make sure that all the resources have been released before a process can enter a blocked state.

    Explanation:

    a) The situation in which the process block itself to wait for an event that will never occur is called deadlock.

    Operating system keeps checking the system for deadlocks and can detect a process that is in deadlock.

    For example Operating System uses resource allocation graph to detect if there is a cycle in the system and this way it detects a blocked process or a process in deadlock state. This is how OS checks the reason for the process to get blocked and also it also examines if that process will get the resource ever. The even here can be a resource that a process wants to use. So OS keeps checking the allocation of resources against each process to detect any such blocked process and also checks the availability of resources.

    b) To prevent the processes to reach a deadlock state the OS can eliminate a condition called hold and wait. So the OS allocates all the resources that are needed by a process before the execution begins. Secondly if the process needs a resource, it cannot be allocated unless the process releases all its current acquired resources. Another way to prevent deadlock is to preempt resources from a process and allocate that resource to a process which has a higher priority.

    One way to prevent processes from waiting for an event that will never occur is to make sure that no cycle is formed. So the processes are given a number that represents the priority of each process. So the resources are allocated according to the priority levels of these processes and also processes can request resources according to their number.

    So the resources request can only be processed if the system does not end up in dead lock.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “4 [3.7] In a block/wake up mechanism, a process blocks itself to wait for an event to occur. Another process must detect that the event has ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers