In the working-set strategy, which of the following is done by the ope...
According to concept of thrashing,
- I is true because to prevent thrashing we must provide processes with as many frames as they really need "right now".If there are enough extra frames, another process can be initiated.
- II is true because The total demand, D, is the sum of the sizes of the working sets for all processes. If D exceeds the total number of available frames, then at least one process is thrashing, because there are not enough frames available to satisfy its minimum working set. If D is significantly less than the currently available frames, then additional processes can be launched.
View all questions of this test
In the working-set strategy, which of the following is done by the ope...
Preventing Thrashing in the Working-Set Strategy
The working-set strategy is a method used by the operating system to manage memory in a computer system. It aims to prevent thrashing, which is a situation where the system spends a significant amount of time swapping pages in and out of memory, resulting in poor performance. To prevent thrashing, the operating system takes certain actions, as explained below:
I. Initiates another process if there are enough extra frames:
- The working-set strategy involves assigning a fixed number of frames to each process, known as the working-set size.
- When a process requires more frames than its allocated working-set size, it indicates the need for additional memory.
- In such cases, the operating system can initiate another process if there are enough extra frames available in the system.
- By starting a new process, the operating system can utilize the available memory efficiently and prevent thrashing by distributing the workload across multiple processes.
II. Selects a process to suspend if the sum of the sizes of the working-sets exceeds the total number of available frames:
- In the working-set strategy, each process has a working-set size, which represents the number of frames it requires to function optimally.
- If the sum of the working-set sizes of all active processes exceeds the total number of available frames in the system, it indicates that there is not enough memory to accommodate all the processes simultaneously.
- In such cases, the operating system needs to select a process to suspend or swap out of memory temporarily.
- The selected process is typically one that is not actively being used or has a lower priority compared to other processes.
- By suspending a process, the operating system can free up memory for other processes and prevent thrashing by ensuring that the active processes have enough memory to execute efficiently.
Therefore, both actions mentioned in options I and II are performed by the operating system to prevent thrashing in the working-set strategy. These actions help optimize memory usage, prevent excessive swapping, and ensure that processes have sufficient memory to execute without significant performance degradation.