The Gateway to Computer Science Excellence
+1 vote
66 views

How to solve it ?

in Operating System by Junior (875 points) | 66 views
0

P2 will never run 

after running 3 times it will print "CCC" and deadlock.

goto statement in C programming provides an unconditional jump from the 'goto' to a labeled statement in the same function.

NOTE − Use of goto statement is highly discouraged in any programming language because it makes difficult to trace the control flow of a program, making the program hard to understand and hard to modify. Any program that uses a goto can be rewritten to avoid them.

+1
No one is signaling L. Okay that causes deadlock.

But what if L1 gets preempted after Signal(R)? A will be printed, right?
0
Oh yeah, in that case it will print "AB" and keeps on printing until R exhausts or P2 is preempted.

thanks for pointing out
0
How is 0 answer but .
0
they are asking smallest number of A's that might be printed.

they mean there exist that scenario where no "A" is printed. If there is no preemption then there will be no A's.
+1
okk got it :o

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,647 questions
56,475 answers
195,396 comments
100,381 users