solution - Operating System : Deadlock (Test 1)
Question : If granting a resource request leads to an unsafe state, the operating system will
Solution :
725320260314111618 Correct Answer : Deny or postpone the request
Description -
If granting a resource request leads to an unsafe state, the operating system will deny or postpone the request.
Why the OS Denies or Postpones the Request
This scenario is a core concept in Deadlock Avoidance (specifically managed by algorithms like the Banker's Algorithm). Here is a step-by-step breakdown of how the operating system decides:
- Safe vs. Unsafe States: A state is considered safe if the operating system can allocate resources to each process in some sequential order and still guarantee that every process can run to completion without causing a deadlock. If no such safe sequence exists, the state is unsafe.
- Risk of Deadlock: An unsafe state does not guarantee a deadlock will happen, but it means the OS can no longer prevent processes from potentially blocking each other indefinitely.
- The OS Strategy: To ensure a deadlock never occurs, the operating system must keep the system strictly within a safe state. Therefore, if a process requests a resource, the OS runs a simulation: "If I give this resource away right now, will the system remain safe?" If the answer is no, the OS postpones the request and puts the process to sleep until other processes finish and release their resources.
Why the Other Options are Incorrect
- Immediately allocate the resource: This defeats the purpose of deadlock avoidance and actively pushes the system into danger.
- Ignore the request: The OS cannot simply ignore a process; it must actively manage it by either blocking it, denying it, or queueing it.
- Terminate the process: Aborting a process is a harsh measure used in Deadlock Detection and Recovery after a deadlock has already happened. In the avoidance phase, the process has done nothing wrong; it just has to wait.
Question : In Banker’s Algorithm, the Need matrix is calculated as
Solution :
614520260314111503 Correct Answer : Need = Max – Allocation
Description -
In the Banker’s Algorithm, the Need matrix is calculated as Need = Max – Allocation.
Explanation of the Formula
The Banker's Algorithm uses several matrices to track resource management and avoid deadlocks:
- Max Matrix: Represents the maximum resource demand of each process. This is the total number of resources a process declares it will need to complete its execution.
- Allocation Matrix: Represents the number of resources currently assigned to each process at this very moment.
- Need Matrix: Represents the remaining resources each process still requires to finish its task.
To find out what a process still needs, the operating system subtracts what the process already has from what it ultimately requires:
\(\text{Need}[i][j]=\text{Max}[i][j]-\text{Allocation}[i][j]\)
Why the Other Options are Incorrect
- Need = Allocation – Max: This is mathematically backward and would result in negative numbers, as a process cannot currently hold more resources than its maximum declared limit.
- Need = Available – Max: "Available" represents the resources currently sitting free in the system pool. Comparing free resources directly to a process's total maximum requirement doesn't calculate its specific outstanding individual need.
- Need = Allocation – Available: This formula has no logical meaning in deadlock avoidance, as it subtracts free system resources from a process's currently held resources.
Question : A system is said to be in a safe state if
Solution :
13720260314111421 Correct Answer : There exists a sequence in which all processes can complete
Description -
A system is said to be in a safe state if there exists a sequence in which all processes can complete.
Explanation of a Safe State
In operating systems, a state is declared safe if the OS can find at least one orderly path—known as a safe sequence—to allocate resources to every process.
- Guaranteed Execution: Even if all processes suddenly demand their maximum declared resources, the system can satisfy them one by one.
- The Chain Reaction: The OS finds a process whose remaining needs can be met by the currently Available That process runs, finishes, and releases all its allocated resources back to the pool. With a now-larger pool, the OS moves on to the next process, repeating this until every process completes without a deadlock.
- Deadlock Avoidance: As long as a safe sequence exists, the system is completely safe from entering a deadlock.
Why the Other Options are Incorrect
- Resources are not allocated: An idle system with no allocations is technically safe, but this is not the definition of a safe state for an active, running system.
- All processes are blocked: If all processes are blocked waiting for each other, the system is likely in a deadlock or starvation state, which is the exact opposite of safe.
- Deadlock has already occurred: If a deadlock is present, the system has already slipped past the unsafe threshold into a completely broken, deadlocked state.
Question : Which algorithm is commonly used for deadlock avoidance in operating systems?
Solution :
786020260314111329 Correct Answer : Banker’s Algorithm
Description -
The algorithm commonly used for deadlock avoidance in operating systems is the Banker’s Algorithm.
Explanation of the Correct Answer
The Banker's Algorithm is a classic resource allocation and deadlock avoidance algorithm developed by Edsger Dijkstra.
- How it works: When a process requests resources, the operating system does not immediately grant them. Instead, it runs a simulation to see if allocating those resources will leave the system in a safe state.
- The "Banker" Analogy: It is named after a bank where customers have lines of credit. The bank will not allocate cash to a customer if it can no longer satisfy the remaining credit needs of all its other customers, ensuring the bank never runs out of cash completely (avoids cash starvation/deadlock).
Why the Other Options are Incorrect
- FCFS (First-Come, First-Served) Algorithm: This is a basic CPU scheduling algorithm (or disk scheduling algorithm) that executes tasks in the order they arrive. It has nothing to do with avoiding deadlocks.
- Round Robin Algorithm: This is a preemptive CPU scheduling algorithm designed for time-sharing systems, where each process gets a small fixed slice of CPU time (time quantum) in a cyclical rotation.
- Paging Algorithm: This refers to memory management strategies (like page replacement algorithms: FIFO, LRU) used to handle virtual memory and decide which pages to swap out to the disk.
Question : Deadlock avoidance in an operating system ensures that the system
Solution :
282720260314111228 Correct Answer : Always remains in a safe state
Description -
Deadlock avoidance in an operating system ensures that the system always remains in a safe state.
Explanation of the Correct Answer
The entire philosophy of deadlock avoidance is based on dynamic prevention through state monitoring.
- State Tracking: The operating system continuously tracks resource allocation metrics. Every time a process requests resources, the OS evaluates whether granting that request will transition the system into an unsafe state.
- Safe State Guarantee: If an allocation threatens to take the system into an unsafe territory (where a safe execution sequence no longer exists), the OS denies or delays that request. By enforcing this strict rule, the system always remains in a safe state, making it mathematically impossible for a deadlock to occur.
Why the Other Options are Incorrect
- Never allocates resources: If the system never allocated resources, no programs could ever run. The goal of an OS is to allocate resources efficiently, not block them entirely.
- Eliminates all processes: Terminating or eliminating processes is a strategy used in Deadlock Detection and Recovery after a deadlock has already happened, not an avoidance strategy.
- Uses only one process: Multi-programming systems run hundreds of processes simultaneously. Restricting the OS to only one process would defeat the purpose of modern multitasking operating systems.
Question : Spooling is mainly used to reduce which deadlock condition?
Solution :
926620260314110430 Correct Answer : Mutual exclusion
Description -
Spooling is mainly used to reduce or eliminate the mutual exclusion deadlock condition.
Explanation of the Correct Answer
For a deadlock to occur, four Coffman conditions must hold true simultaneously. One of these is mutual exclusion, which states that at least one resource must be held in a non-shareable mode (only one process can use it at a time, like a physical printer).
Spooling (Simultaneous Peripheral Operations On-Line) intercepts these exclusive resource requests:
- The Buffer System: Instead of allowing a process to grab direct, exclusive control of a hardware device, the operating system intercepts the data and writes it to a temporary queue on a fast storage device (like a disk or SSD).
- Breaking the Condition: Because multiple processes can write their data to the spooling disk at the exact same time, the resource appears completely shareable to them.
- The Printer Example: If three processes try to print simultaneously without spooling, the first one locks the printer (mutual exclusion), forcing the others to wait, which can trigger a deadlock. With spooling, all three write to the disk immediately without blocking, and a system daemon prints the files one by one later.
Why the Other Options are Incorrect
- Circular wait: This condition is broken by imposing a total ordering on all resources and forcing processes to request them in a strictly increasing numerical order.
- Hold and wait: This condition is prevented by forcing a process to request all its required resources at once before it begins execution, or by making it release its current resources before requesting new ones.
- No preemption: This condition is bypassed by allowing the operating system to forcibly take away (preempt) allocated resources from a waiting process if its next request cannot be satisfied immediately.
Question : The hold and wait condition occurs when:
Solution :
752220260314110333 Correct Answer : A process holds one resource and waits for another
Description -
The hold and wait condition occurs when
a process holds one resource and waits for another.
Explanation of the Correct Answer
The hold and wait condition is one of the four necessary conditions (known as the Coffman conditions) that must be present for a deadlock to happen.
- The Core Mechanism: It means that a process is not empty-handed while it waits. It has already been allocated at least one resource (it is holding it) and is actively requesting additional resources that are currently being held by other processes (it is waiting for them).
- The Deadlock Threat: Because the process refuses to give up the resource it already owns while it waits for the next one, it creates a dependency chain. If multiple processes do this in a circle, a deadlock occurs.
Why the Other Options are Incorrect
- A process releases all resources before requesting another: This is actually a strategy used to prevent the hold-and-wait condition. If a process releases everything before making a new request, it never holds while waiting.
- Processes never wait for resources: If processes never have to wait, resources are always instantly available, meaning a deadlock could never occur.
- Processes terminate automatically: Automatic termination is a recovery mechanism or a program lifecycle event, not a definition of a resource allocation state.
Question : Which of the following is a practical way to prevent circular wait?
Solution :
351020260314110234 Correct Answer : Assign priorities to resources
Description -
A practical way to prevent circular wait is to assign priorities to resources (also known as global resource ordering).
Explanation of the Correct Answer
The circular wait condition occurs when a cycle of processes exists, where each process holds a resource and waits for the next resource in the chain (e.g., Process A holds R1 and waits for R2; Process B holds R2 and waits for R1).
To prevent this condition from ever happening, the operating system can use a technique called resource ordering:
- Assign a Unique ID/Priority: The OS assigns a strict linear ordering (a priority number or integer index) to every single resource in the system (e.g., Disk Drive = 1, Printer = 2, Database Lock = 3).
- Enforce Request Rules: The system strictly requires that a process can only request resources in an increasing order of these priorities.
- Breaking the Cycle: If a process holds the Printer (2), it is forbidden from requesting the Disk Drive (1). It must release the Printer first if it wants to get the Disk Drive. Because everyone follows the same strict upward ladder, it is mathematically impossible to form a closed waiting loop or cycle.
Why the Other Options are Incorrect
- Remove processes: While aborting processes can recover from a deadlock after it happens, it is not a proactive design method used to prevent the structural rule of circular wait.
- Increase CPU speed: Deadlocks are logical resource-allocation issues, not performance issues. Making the CPU faster will only make the processes reach the deadlocked state quicker.
- Reduce memory: Lowering system memory restricts available resources and increases the likelihood of processes blocking, which makes deadlocks worse rather than preventing them.
Question : Which of the following conditions must be removed to prevent deadlock?
Solution :
256420260314110145 Correct Answer : Any one of the above
Description -
To prevent a deadlock from occurring, you must remove any one of the above conditions.
Explanation of the Correct Answer
For a deadlock to happen, all four Coffman conditions must hold true simultaneously in the system. These conditions are:
- Mutual exclusion: At least one resource must be held in a non-shareable mode.
- Hold and wait: A process must hold at least one resource and wait for another.
- No preemption: Resources cannot be forcibly taken from a process; they must be released voluntarily.
- Circular wait: A closed chain of processes exists, where each process waits for a resource held by the next.
Because a deadlock is like a chain that requires every single link to be intact to function, breaking even a single link completely prevents deadlocks. Therefore, if you successfully eliminate any one of these conditions through careful operating system design, a deadlock becomes structurally impossible.
Why the Other Options are Incorrect
- Mutual exclusion / Hold and wait / No preemption individually: While removing any of these specific conditions will prevent a deadlock, choosing just one as the exclusive answer ignores the fundamental rule that eliminating any of them achieves the same goal. Selecting "Any one of the above" is the most complete and accurate answer.
Question : Deadlock prevention ensures that:
Solution :
334020260314110048 Correct Answer : Deadlock never occurs in the system
Description -
Deadlock prevention ensures that deadlock never occurs in the system.
Operating systems handle deadlocks using different strategies, and Deadlock Prevention is a proactive method:
- Proactive Elimination: Deadlock prevention works by designing the system's rules so that at least one of the four necessary Coffman conditions (Mutual Exclusion, Hold and Wait, No Preemption, or Circular Wait) can never hold true.
- Complete Avoidance: Because a deadlock requires all four conditions to exist simultaneously, structurally eliminating even one condition ensures that a deadlock never occurs in the system in the first place.
Why the Other Options are Incorrect
- Deadlock is detected after it occurs / Deadlock is recovered: These describe Deadlock Detection and Recovery In those systems, the OS allows deadlocks to happen, periodically runs a detection algorithm, and then recovers (e.g., by killing a process). Prevention aims to ensure it never happens at all.
- Deadlock is ignored: This refers to the Ostrich Algorithm, where the OS pretends deadlocks don't exist because they are rare, which is completely different from a structural prevention strategy.
Question : Which of the following is NOT a strategy for handling deadlocks?
Solution :
679120260314105749 Correct Answer : Deadlock scheduling
Description -
The strategy that is NOT a valid method for handling deadlocks is Deadlock scheduling.
Explanation of the Correct Answer
In operating systems, there are exactly four universally recognized strategies for dealing with deadlocks. "Deadlock scheduling" is not a real concept or terminology used in OS resource management. While scheduling algorithms exist (like CPU scheduling), they deal with execution order and timing, not the elimination or management of deadlocked resource states.
Why the Other Options are Valid Strategies
The actual, recognized strategies for handling deadlocks are:
- Deadlock prevention: A proactive approach that structures system rules so that at least one of the four Coffman conditions (Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait) can mathematically never occur.
- Deadlock avoidance: A dynamic approach where the OS evaluates every resource request in real-time (using methods like the Banker's Algorithm) and only grants it if the system remains in a safe state.
- Deadlock detection and recovery: A reactive approach where the OS allows deadlocks to happen, periodically runs a tracking algorithm to find them, and then recovers by preempting resources or terminating deadlocked processes.
- Ignorance (The Ostrich Algorithm): Not listed here, but this is the fourth strategy where the OS ignores the problem completely if deadlocks are rare and the cost of prevention is too high.
Question : Which strategy allows deadlocks to occur and then detects and resolves them?
Solution :
309320260314105650 Correct Answer : Deadlock detection and recovery
Description -
The strategy that allows deadlocks to occur and then detects and resolves them is Deadlock detection and recovery.
This approach is a reactive strategy rather than a proactive one. Instead of spending continuous system overhead trying to prevent or avoid deadlocks ahead of time, the operating system adopts a hands-off policy:
- Permissive Allocation: The OS grants resource requests freely as long as resources are available, even if it puts the system into an unsafe state.
- Periodic Detection: The OS periodically runs a background algorithm (such as a Wait-For Graph or a detection variant of the Banker's Algorithm) to inspect resource allocations and look for cycles.
- Recovery Phase: Once a deadlock is officially detected, the OS steps in to resolve it using recovery mechanisms. This usually involves either terminating one or more deadlocked processes or preempting (forcibly taking back) resources from certain processes until the cycle breaks.
Question : In deadlock avoidance, the operating system allocates resources only if:
Solution :
987020260314105603 Correct Answer : The system remains in a safe state
Description -
In deadlock avoidance, the operating system allocates resources only if the system remains in a safe state.
- Safe State Guarantee: A state is considered "safe" if the operating system can allocate resources to each process up to its maximum claim in some order, while still avoiding a deadlock.
- The Banker's Algorithm: This classic deadlock avoidance algorithm dynamically checks the resource-allocation state before granting any request. If allocating the resource would transition the system into an unsafe state (where a deadlock might occur), the OS forces the requesting process to wait, even if the resources are currently free.
Why Other Options Are Incorrect
- The process has highest priority: Priority scheduling helps manage CPU execution order, but it does not inherently prevent or avoid deadlocks.
- The CPU is free: CPU availability is related to process scheduling, not the allocation of mutually exclusive resources (like disk drives or printers) that cause deadlocks.
- All resources are available: Processes rarely need all system resources simultaneously; they only request what they need. The OS can safely allocate resources even if some are being used by other processes.
Question : Deadlock prevention works by:
Solution :
20260314105503 Correct Answer : Eliminating at least one of the necessary conditions of deadlock
Description -
Deadlock prevention works by eliminating at least one of the necessary conditions of deadlock.
For a deadlock to occur, four necessary conditions (known as the Coffman conditions) must hold simultaneously. Deadlock prevention techniques prevent deadlocks by designing the system protocol so that at least one of these conditions can never happen:
- Mutual Exclusion: At least one resource must be held in a non-shareable mode.
- Prevention strategy: Make resources shareable (e.g., read-only files). However, this is impossible for inherently non-shareable resources like printers.
- Hold and Wait: A process must be holding at least one resource and waiting to acquire additional resources that are currently being held by other processes.
- Prevention strategy: Require processes to request and receive all required resources before execution begins, or force them to release all held resources before requesting new ones.
- No Preemption: Resources cannot be forcibly taken from a process; they can only be released voluntarily.
- Prevention strategy: If a process holding resources requests another resource that cannot be immediately allocated, the OS forcibly preempts (releases) its currently held resources.
- Circular Wait: A closed chain of processes exists, where each process holds one or more resources that are needed by the next process in the chain.
- Prevention strategy: Impose a total ordering of all resource types and require that each process requests resources in a strictly increasing order of enumeration.
Why the Other Options are Incorrect
- Detecting deadlocks periodically: This describes deadlock detection, which allows deadlocks to happen first and then searches for them using tools like Wait-For Graphs.
- Killing processes immediately: This is a deadlock recovery mechanism used after a deadlock has already been detected to break the cycle.
- Restarting the system: This is a brute-force recovery method (often called the Ostrich algorithm or manual intervention) used when the system freezes, not a designed architectural prevention strategy.
Question : Which strategy assumes that deadlock rarely occurs and the operating system simply ignores it?
Solution :
714720260314105419 Correct Answer : Deadlock ignorance
Description -
The strategy that assumes deadlocks rarely occur and simply ignores them is Deadlock ignorance (often referred to as the Ostrich Algorithm).
The Explanation
- The Ostrich Algorithm: This strategy gets its name from the common myth that ostriches stick their heads in the sand when facing danger, hoping it will go away.
- The Core Philosophy: The operating system designer assumes that deadlocks happen very infrequently, and the performance cost of constantly checking for, avoiding, or preventing them is too high. Therefore, the OS completely ignores the problem.
- Real-World Use: Surprisingly, most general-purpose operating systems like Windows, Linux, and macOS use this strategy for standard user processes. They trade the mathematical certainty of avoiding deadlocks for raw system performance and responsiveness. If a deadlock actually does happen, the system relies on the user to manually kill the stuck application or reboot the machine.
Why the Other Options are Incorrect
- Deadlock prevention: This actively designs the system protocol to eliminate one of the four necessary conditions for deadlocks, introducing strict limits on how processes request resources.
- Deadlock avoidance: This dynamically checks every single resource request at runtime (using methods like the Banker's Algorithm) to ensure the system never enters an unsafe state.
- Deadlock detection: This allows deadlocks to happen but runs background algorithms periodically to find them and initiate recovery protocols (like killing processes).
Question : In a deadlock situation, what happens to the processes?
Solution :
62020260314105129 Correct Answer : They remain blocked and cannot proceed
Description -
In a deadlock situation, the processes remain blocked and cannot proceed.
- Permanent Wait: A deadlock occurs when a set of processes are trapped in a circular chain of dependencies. Each process holds a resource that another process needs, while waiting for a resource held by yet another process.
- Lack of Triggers: Because every process in the cycle is blocked waiting for a resource to be freed, none of them can ever execute a command to release the resources they currently hold. Without external intervention (like the OS killing a process or a user rebooting the computer), these processes will remain in this asleep/blocked state indefinitely.
Why the Other Options are Incorrect
- They execute faster: Processes consume zero CPU execution time while deadlocked because they are entirely frozen waiting for resources.
- They terminate automatically: Processes have no built-in awareness that they are deadlocked; they will wait forever unless the operating system's detection mechanism explicitly terminates them.
- They release resources automatically: Processes only release resources voluntarily when they complete their tasks. Since they cannot progress, they can never reach the code instructions that release their resources.
Question : Which condition means a process holds a resource while waiting for another resource?
Solution :
696020260314105032 Correct Answer : Hold and wait
Description -
The condition where a process holds at least one resource while waiting to acquire another resource is Hold and wait.
- The Core Mechanism: The Hold and Wait condition requires that a process must be concurrently "holding" a resource it has already been allocated, while simultaneously "waiting" in a blocked state for additional resources that are currently occupied by other processes.
- Example: Process \(P_{1}\) is allocated the printer (holding). While still keeping the printer, it requests the scanner, which is currently being used by Process \(P_{2}\). \(P_{1}\) goes to sleep waiting for the scanner but refuses to let go of the printer. This creates the perfect breeding ground for a deadlock.
Why the Other Options are Incorrect
- Mutual exclusion: This means a resource can only be held by one process at a time (non-shareable mode). It does not describe the act of a process waiting for a second resource.
- Circular wait: This is the resulting chain reaction where Process \(A\) waits for \(B\), \(B\) waits for \(C\), and \(C\) waits for \(A\). While "Hold and Wait" is required to form this loop, Circular Wait specifically refers to the closed cycle of dependencies.
- Preemption: This is actually an operating system action (forcibly taking a resource away from a process). The deadlock condition is No Preemption, meaning resources cannot be stolen.
Question : Which of the following is NOT a necessary condition for deadlock?
Solution :
696920260314104957 Correct Answer : Multitasking
Description -
The option that is NOT a necessary condition for a deadlock is Multitasking.
For a deadlock to occur, the four Coffman conditions must hold simultaneously: Mutual exclusion, Hold and wait, No preemption, and Circular wait.
- Why Multitasking is NOT a condition: Multitasking (or multiprocessing) is a broad operating system feature that allows multiple tasks to share a single CPU core by switching between them. While deadlocks usually occur in environments where multiple tasks run concurrently, multitasking itself is not a formal algorithmic requirement for a deadlock. Deadlocks can occur in simpler multi-threaded or multi-programmed environments without a full multitasking operating system framework, provided the core resource-sharing conditions are met.
Why the Other Options Are Necessary Conditions
- Mutual exclusion: If resources could be shared freely by everyone at the same time, no process would ever have to wait, making a deadlock impossible.
- Hold and wait: If a process had to give up its current resources before asking for new ones, it would never block other processes while waiting.
- Circular wait: This is the actual gridlock loop (Process A waits for B, who waits for A). Without this closed cycle of dependencies, the system would eventually clear up as processes finish their work.
Question : Deadlock mainly occurs due to competition for:
Solution :
749620260314104851 Correct Answer : Resources
Description -
Deadlock mainly occurs due to competition for Resources.
The Explanation
- The Core Definition: In operating systems, a deadlock is explicitly defined as a situation where two or more processes are unable to proceed because each is waiting for a resource held by the other.
- What Qualifies as a Resource? These resources can be physical hardware components (like printers, disk drives, tape drives, or GPU memory) or logical software entities (like database locks, semaphores, file locks, or shared memory segments). Deadlocks happen because these resources are often non-shareable (mutually exclusive) and finite, forcing processes to compete and wait for them.
Why the Other Options are Incorrect
- CPU registers: CPU registers are extremely fast, volatile storage locations inside the processor itself. The operating system's CPU scheduler completely saves and restores register states (context switching) whenever a process shifts execution, so processes do not get locked out competing for them.
- Cache memory: Cache memory (L1, L2, L3) is managed automatically by the hardware architecture and memory management unit (MMU) using replacement policies (like LRU). Processes do not request exclusive locks on cache lines, meaning they cannot deadlock over them.
- Internet connection: While network bandwidth can cause slowdowns or congestion (starvation), network sockets or internet connections themselves are handled via network layers and timeouts. They do not follow the strict exclusive "Hold and Wait" locking mechanisms that cause classic system deadlocks.
Question : What is a deadlock in an operating system?
Solution :
915020260314104802 Correct Answer : When processes wait indefinitely for resources held by each other
Description -
A deadlock in an operating system is when processes wait indefinitely for resources held by each other.
The Explanation
- The Standoff: A deadlock is a specific system state where a set of processes are completely frozen because they are trapped in a circular chain of dependencies. Every process in the set is waiting for a resource, but that specific resource is currently being held by another waiting process in the same set.
- The Traffic Jam Analogy: Imagine a four-way intersection where four cars arrive at the exact same time, and each car stops to let the car to its right go first. None of the cars can move forward because they are all waiting for someone else to move. This permanent block is exactly how a deadlock behaves inside an operating system.
Why the Other Options are Incorrect
- When CPU stops working: The CPU hardware is still perfectly functional during a deadlock. In fact, it might even drop to 0% utilization because the deadlocked processes are completely asleep and not asking for computation time.
- When a process terminates unexpectedly: This describes a process crash or abnormal termination (often due to an unhandled exception or segment fault), not a deadlock.
- When memory becomes full: Running out of RAM triggers an Out-Of-Memory (OOM) error or forces the OS to rely heavily on virtual memory swapping. It does not inherently mean processes are trapped waiting for each other in a resource cycle.