










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











2
Page fault, Divide by zero, System call
Timer, keyboard, disk
4
5
7
8
10
11
Examples: mutex lock, semaphore, barrier
13
shared int X = 0;
Process P1 (^) Process P
time
Context Switch
Context Switch
14
P1 loads X into R1, increments R
P2 loads X into register before P1 stores new value into X
Net result: P1 stores 1, P2 stores 1
16
17
while ( L == 1) ;
wait: LW R1, Addr(L)
BNEZ R1, wait
SW R1, Addr(L)