3.7k views

Choose the correct alternatives (more than one can be correct) and write the corresponding letters only:

Indicate all the false statements from the statements given below:

1. The amount of virtual memory available is limited by the availability of the secondary memory
2. Any implementation of a critical section requires the use of an indivisible machine- instruction ,such as test-and-set.
3. The use of monitors ensure that no dead-locks will be caused .
4. The LRU page-replacement policy may cause thrashing for some type of programs.
5. The best fit techniques for memory allocation ensures that memory will never be fragmented.

edited | 3.7k views
+12
The use of monitors ensure mutual exclusion but not deadlock
+1

The LRU page-replacement policy may cause thrashing for some type of programs.

somone pls help.wht does it mean

+7
if u consider the sequence like 12341234......... assume no of frames is 3 then here every page results page fault in LRU It leads to lot of page movements so it causes thrashing
0
Option b is true. Peterson solution cannot guarantee mutual exclusion. This line is mentioned in Galvin itself. In fact without the use of atomic instruction synchronization cannot be guaranteed.

1. (A) is true.
2. This is false. Example :- Peterson's solution is purely software based solution without use of hardware.https://en.wikipedia.org/wiki/Peterson's_algorithm
3. False. Reference: https://en.wikipedia.org/wiki/Monitor_(synchronization)
4. True. This will happen if page getting replaced is immediately referred in next cycle.
5. False. Memory can get fragmented with First fit.

edited by
+2
+1
Updated.
+1

why b is false?

+1
option b should be true.
+3
+3

Arjun Sir ,

In Option B)

This is false. Example :- Peterson's solution is purely software based solution without use of hardware.

Sir but the context here is if we need indivisible machine instructions or not ?

So both {test and set (which uses hardware) } and {peterson's solution (which uses Software Implementation) } will fall in the same category according to the context.So it should be true.

Where am I going wrong ?

+1
+1
+2
@Arjun sir. How can monitor causes deadlock?
+8
Whatever be the case "External Fragmentation" can occur is all three types i.e best fit, first fit, wrost fit.

That might be an typeo in the answer for part E. But answer is correct the statement is false.
+1

Option B should be TRUE. It's written clearly in Galvin. Also see the wikipedia page: https://en.wikipedia.org/wiki/Peterson's_algorithm#Note

0
I didn't get C from the reference given..

At most one thread can be active inside the monitor at any given time. If others try to enter we don't allow them and they are kept waiting. Once the process inside has done executing, then one of the waiting processes is notified. In this way how can deadlock occur?
+3

http://courses.cs.vt.edu/~cs5204/fall00/monitor.html

navigate to 'LIMITATIONS OF MONITORS'

this might help.

0
0

@Asim Siddiqui 4's link really explains the rationale behind option (C)

+1

@Arjun @Akash Kanase The Wikipedia link given in the answer for option (B) contains the following text.

The algorithm satisfies the three essential criteria to solve the critical section problem, provided that changes to the variables turnflag[0], and flag[1] propagate immediately and atomically. The while condition works even with preemption.

Doesn't this imply that atomic instructions are essential to implement Peterson's algorithm as well?

0

Point E is:

The best fit techniques for memory allocation ensures that memory will never be fragmented.

False. Memory can get fragmented with First fit.

Question asks about best fit, you explained first fit. I guess two are different, even though I feel both can cause fragmentation.

0

@Asim Siddiqui 4 @zeeshanmohnavi I doubt about monitor point. Monitor is a construct just like read-write instructions (test-and-set, compare-and-swap, exchange etc) and these are used to develop code which will satisfy critical section problem criteria (bounded wait, mutual exclusion and progress) and as such it does not guarantees against or for deadlock on itself. Thats why @Asim Siddiqui 4 link describes scenario where deadlock can occur while using monitor, whereas page 21 of this ppt says "guarantees against deadlock". Am I correct with this?

0
C should be true

Since Monitors have an important property that only one process can be active in the monitor at any time. This will guarantee Mutual Exclusion and hence prevent inconsistency and deadlock.

before answering some points to know:-

• Monitor is one of the ways to achieve Process synchronization. Monitor is supported by programming languages to achieve mutual exclusion between processes.
• Peterson's solution is the purely software-based solution without the use of hardware.

• if u consider the sequence like 12341234......... assume no of frames is 3 then here every page results page fault in LRU It leads to a lot of page movements so it causes thrashing
• now go and see selected answer
0
is test and set  is it hardware implementation
+1
Yes test and set is a hardware approach
A is true as amount of virtual memory is limited by length of MAR and available secondary storage.

D is false as best fit technique causes internal fragmentation.

Not sure about B and C.
0

"Best fit" is an algo to find the "holes" ( empty space) in Dynamic Partitioning . Dynamic Partitioning does not cause Internal Fragmentation. External Fragmentation is possible

+1 vote

b)False

c)

d)In any replacement policy thrashing could happen, but it mainly causes in time sharing system

thrashing

e) False. It minimize fragmentation onlyLink

by
+1
@srestha in best fit there will be external fragmentation right
+1