in Operating System edited by
410 views
0 votes
0 votes
Suppose there is a (non-virtual memory) system that has only 200 Mb of main memory and there are two processes that make the following sequence of requests:

 

P1             P2

...     ...

Request 80Mb;    Request 70Mb;

...     ...

Request 60Mb;     Request 80Mb;

Consider the following statements:

Statement 1: P1 requests 80 Mb and then P2 requests 70 Mb. This is a deadlock.

Statement 2: There is no possibility of a deadlock.

Which of the above statements are correct?
in Operating System edited by
410 views

1 comment

What answer they have provided?
0
0

1 Answer

1 vote
1 vote

Statement 1- It is correct because we have limited memory of 200Mb. As per options, we can figure out that both process are running concurrently and first p1 take 80Mb from 200, so 200-80=120MB remaining. After that, P2 demands 70Mb, so 120-70=50Mb reaming. And 50 Mb is not sufficient for either of the processes to complete. P1 will wait for P2 to complete and release captured memory, and p2 will wait for p1 to get complete and release captured memory. Here both process will get stuck and this is deadlock.

Statement 2-  Because of statement 1 is true, statement 2 is false.

Related questions