In the working-set strategy, which of the following is done by the operating…

2006

In the working-set strategy, which of the following is done by the operating system to prevent thrashing?

  1. It initiates another process if there are enough extra frames.

  2. It selects a process to suspend if the sum of the sizes of the working-sets exceeds the total number of available frames.

  1. A.

    I only

  2. B.

    II only

  3. C.

    Neither I nor II

  4. D.

    Both I and II

Attempted by 169 students.

Show answer & explanation

Correct answer: D

Answer: Both statements are true.

Key idea: The working-set strategy tracks the set of pages a process needs to run efficiently. The OS uses working-set information to admit or suspend processes so that the total resident pages fit available frames and thrashing is avoided.

  • If there are enough extra free frames beyond the current working sets, the OS can initiate (admit) another process by allocating frames for its working set. This makes use of idle memory without causing thrashing.

  • If the sum of all processes' working-set sizes exceeds the total available frames, the OS selects one or more processes to suspend (swap out) or reduce resident pages. This reduces contention for frames and prevents thrashing.

Therefore, both actions described in the question are used by the OS under the working-set strategy to maintain a balance between multiprogramming and available memory and to prevent thrashing.

Explore the full course: Gate Guidance By Sanchit Sir