If process Pi is executing in its critical section, then no other processes can be
executing in their critical sections
executing in their critical sections
Anonymous Quiz
8%
Progress
12%
Bounded Waiting
80%
Mutual Exclusion
Peterson’s Solution is … to be synchronized
Anonymous Quiz
6%
limited to 1 process
6%
limited to 3 processes
79%
limited to 2 processes
9%
unlimited
in Peterson’s Solution entry section of process i contains
Anonymous Quiz
17%
while(flag[i] && turn == i);
22%
while(flag[j] && turn == i);
9%
while(flag[i] && flag == j
52%
while(flag[j] && turn == j);
in Peterson’s Solution entry section of process j contains
Anonymous Quiz
76%
while(flag[i] && turn == i);
14%
while(flag[j] && turn == i);
10%
while(flag[j] && turn == j);
in Peterson’s Solution exit section of process i contains
Anonymous Quiz
19%
flag[j] = false
13%
flag[j] = true
13%
flag[i] = true
55%
flag[i] = false
in Peterson’s Solution exit section of process j contains
Anonymous Quiz
73%
flag[j] = false
9%
flag[j] = true
8%
flag[i] = false
10%
flag[i] = true
to solve critical section problem Disabling interrupts is efficient on multiprocessor systems
Anonymous Quiz
54%
F
46%
T
we have a shared lock variable which can take one of the two values, 0 or 1
Anonymous Quiz
89%
Test_and_set
11%
CompareAndSwap
The Test_and_Set takes a shared variable called offset that represent the lock status and return its
original value and then set the variable to true which means the lock is disabled
original value and then set the variable to true which means the lock is disabled
Anonymous Quiz
51%
T
49%
F
in Test_and_Set entry section
Anonymous Quiz
70%
while(test_and_set(&lock));
30%
while(test_and_set(&lock) == false)
in CompareAndSwap entry section
Anonymous Quiz
31%
while(compare_and_swap(&lock, 0, 1) == 0);
69%
while(compare_and_swap(&lock, 0, 1) != 0);
Simplest is mutex lock, boolean variable indicating if lock is available or not
Anonymous Quiz
88%
T
12%
F