Professional Documents
Culture Documents
Lec-19 Ipad
Lec-19 Ipad
Reader -
wnterpobez
Reader thread → Read
①
.
threads →
while @
|②|
② writer
update
P Readers
① if > are
reading
→
Noisome ✗ .
② > 1 writers .
OR if writer && some other
thread ( R / w)
,
,
parallels,
→ Race conditions
& data inconstant
←
"
ab¥ OR # abed .
.
Solh to R W problems
Sema phons -
-
No .
two threads modify R.cat
sometime .
-
common fur both readers writer
, .
reading in Crs
writer so In
DT
wait Cwrt)
;
11 do write
operation .
signal Cort;
3 while ( true) ;
Read 1h
do {
wait ( minter ) ; 11 to muten read cont variable
rctt ;
if @ ==
1)
wait Cwrt) ; I/ ensures no writer can enter if there is
signal @ intern ) ;