10,473 views
40 votes
40 votes

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. I only
  2. II only
  3. Neither I nor II
  4. Both I and II

5 Answers

Best answer
69 votes
69 votes

Extract from Galvin "If there are enough extra frames, another process can be initiated. If the sum of the working-set sizes increases, exceeding the total number of available frames,the operating system selects a process to suspend. The process’s pages are written out (swapped), and its frames are reallocated to other processes. The suspended process can be restarted later."

So Option (D)

selected by
5 votes
5 votes

ANS - D

Thrashing is a condition or a situation when the system is spending a major portion of its time in servicing the page faults, but the actual processing done is very negligible.

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.

2 is true because to avoid thrashing process must be suspended.

4 votes
4 votes

In layman terms working set is used to predict locality of a process, so that we can predict how many and what pages a process may be needed for execution. If we do this we can reduce no of page faults and hence thrashing can be reduced.

Wss i = working set required by an i_th process

∑ Wss i = sum of the sizes of the working-sets

D = total number of available frames.

Case 1 : D > ∑ Wss i

Before the start of referring pages for a process, with the help of pre-paging we bring all the pages required by a process into the available frames. We can do this for every process because we have enough frames since D > ∑ Wss i . 

"It initiates another process if there are enough extra frames". This line means we can pre-fetch the pages required for a process into available frames and start its execution.If we do this chance of thrashing are very less because very less page faults may occur.

Case 2 : D < ∑ Wss i

We have less total frames than total pages required by all processes, then the chance of page fault is very high.To prevent page fault we suspend a victim process ( i.e move it secondary memory). When we suspend the process then '∑ Wss i' term decreases then chances of page fault decrease, hence chance of thrashing decreases

 

Answer:

Related questions

30 votes
30 votes
4 answers
1
Ishrat Jahan asked Oct 31, 2014
12,619 views
The arrival time, priority, and duration of the CPU and I/O bursts for each of three processes $P_1, P_2 $ and $P_3$ are given in the table below. Each process has a CPU ...
28 votes
28 votes
2 answers
4