03.05.2013 Views

Concurrency en race condities

Concurrency en race condities

Concurrency en race condities

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Niet-atomaire opdracht<strong>en</strong><br />

• Bij gelijktijdige b<strong>en</strong>adering van e<strong>en</strong> item door<br />

twee tak<strong>en</strong>/threads kunn<strong>en</strong> problem<strong>en</strong><br />

optred<strong>en</strong>.<br />

• B.v. C-expressie: n++<br />

• Pseudo-assembler:<br />

mov rega, n # inhoud n naar register a<br />

inc rega # increm<strong>en</strong>t op register a<br />

mov n, rega # inhoud register a naar n<br />

• Drie operaties. E<strong>en</strong> interrupt, dus e<strong>en</strong> threadswitch<br />

kan overal optred<strong>en</strong>.<br />

• n++ is niet-atomair.<br />

College OS 2010 – 2011 4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!