logo

Crowdly

Browser

Add to Chrome

Questions Bank (1579656 total)

What is value of binary  semaphore "S" after executing 10

P (Wait) operations if the initial value of "S" is 1? how many process will be blocked?

0%
0%
0%
0%
View this question
Who are the speakers talking about?
0%
0%
100%
0%
View this question

Познач ознаки найвищого (п’ятого) рівня спілкування

✅
❌
❌
✅
❌
✅
View this question

Укажи, на яких фото люди дбають про своє здоров’я

❌
✅
❌
✅
View this question

Познач способи зараження ВІЛ / СНІД

❌
✅
❌
✅
View this question
When is the man leaving for his holiday?
0%
0%
0%
0%
View this question
What seems to be the problem?
0%
0%
0%
100%
View this question

boolean blocked[2];

int turn;

void P(int id) {

while(true) {

blocked[id] = true;

while(turn != id) {

while(blocked[1-id])

/* do nothing */;

turn = id;

}

/* critical section */

blocked[id] = false;

/* remainder */

}

}

void main() {

blocked[0] = false;

blocked[1] = false;

turn = 0;

parbegin(P(0), P(1)); //RUN P0 and P1 parallel

The  above code provide satisfies progress   or not?

100%
0%
View this question
When does the man need to send the order to his client?
0%
0%
0%
0%
View this question

Binary semaphore S1=1  and S2=0

int x=10

p0()

{

          p(s1)

          x=x+1

       v(s2)

}

        ---------------        p1()

{

          p(s2)

          x=x+1

       v(s1)

}

what will be the value of x  after execution of p0 and p1?

0%
0%
0%
View this question