16,737 views
55 55 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

4 Answers

Best answer
80 80 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
11 11 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.

5 5 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:
Position:
Show:

Related questions

45 45 votes
7 answers 7 answers
21.6k
21.6k views
Ishrat Jahan asked Oct 31, 2014
21,559 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 ...
31 31 votes
2 answers 2 answers
10.5k
10.5k views
Ishrat Jahan asked Nov 1, 2014
10,530 views
The wait and signal operations of a monitor are implemented using semaphores as follows. In the following,$x$ is a condition variable,mutex is a semaphore initialized to ...
52 52 votes
6 answers 6 answers
21.4k
21.4k views
Ishrat Jahan asked Oct 31, 2014
21,385 views
Consider the solution to the bounded buffer producer/consumer problem by using general semaphores $S, F,$ and $E$. The semaphore $S$ is the mutual exclusion semaphore ini...
47 47 votes
3 answers 3 answers
20.1k
20.1k views
Ishrat Jahan asked Oct 31, 2014
20,094 views
The process state transition diagram of an operating system is as given below.Which of the following must be FALSE about the above operating system?It is a multiprogramme...