Шукаєте відповіді та рішення тестів для OS LAB EVEN SEM 24-25? Перегляньте нашу велику колекцію перевірених відповідей для OS LAB EVEN SEM 24-25 в moodle.spit.ac.in.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
The enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows:
void enter_CS(X)
{
while(test-and-set(X));
}
void leave_CS(X)
{
X = 0;
}
In the above solution, X is a memory location associated with the and is initialized to
. The above construct used by process p1 and p2. So above construct leads to deadlock?
Process P1 and P2 use flag which is initialized to 0 in the below code segment to access critical section
try-enter_cs()
{
if (flag==0)
{
flag=1;
<CS>
flag=0;
}
}
The above code leads to
The enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows:
void enter_CS(X)
{
while(test-and-set(X));
}
void leave_CS(X)
{
X = 0;
}
In the above solution, X is a memory location associated with the and is initialized to
. The above construct used by process p1 and p2. So above construct ensures ME?
The following program consists of 2 concurrent processes and 2 binary semaphores. The semaphores are initialized as S0=1, S1=0
Process P0 | Process P1 | |
while (true) { wait (S0); print (0); release (S1); } | wait (S1); Release (S0); |
At a particular time of computation the value of a counting semaphore is 7.Then 20 V operations and 15 P operations were completed on this semaphore.The resulting value of the semaphore is :
Semaphore S=1, there are 5 processes po,p1,p2,p3,p4
p0,p1,p2,p3 executes while (1) { P(S) <CS.> V(S) } | p4 executes while (1) { V(S) <CS.> V(S) } |
---|
How many maximum number of processes can be present in critical section at any point of time?
An operating system uses bankers algorithm for deadlock avoidance when managing the allocation of three resource types x,y,z to three processes p0,p1,p2 .
The allocation matrix show the number of allocated resourses and max shows the maximum resources needed by processes during its execution.
|
Allocation
|
Max
| ||||
|
X
|
Y
|
Z
|
X
|
Y
|
Z
|
P0
|
0
|
0
|
1
|
8
|
4
|
3
|
P1
|
3
|
2
|
0
|
6
|
2
|
0
|
P2
|
2
|
1
|
1
|
3
|
3
|
3
|
There are 3 units of type X, 2 units of type Y and 2 units of type Z resourses still available.
Consider the following independent request for additional resources in the current state .
REQ1: p0 request 0 units of x, 1 units of y and 1 units of z
REQ2: p1 request 2 units of x, 0 units of y and 0 units of z
Which one of the following is true?
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!