Concurrency en race condities
Concurrency en race condities
Concurrency en race condities
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Compare-and-swap<br />
• TAS schrijft altijd - duur voor SMP cache<br />
• Compare-and-swap instructie CS in de<br />
instructieset IBM 370 <strong>en</strong> Motorola 68000.<br />
(Boek Mil<strong>en</strong>kovic)<br />
– CS is e<strong>en</strong> ondeelbare instructie (ook op e<strong>en</strong> multiprocessor<br />
kan ook e<strong>en</strong> andere processor niet<br />
tuss<strong>en</strong>door aan het geheug<strong>en</strong> zitt<strong>en</strong>)<br />
– “Optimistische” afscherming<br />
• Ga kritieke sectie in<br />
• Test net voor terugschrijv<strong>en</strong> kritieke variabele<br />
– Schrijft alle<strong>en</strong> bij succes<br />
College OS 2010 – 2011 20