11.07.2015 Views

Principper for Samtidighed og Styresystemer - Processer og Tråde

Principper for Samtidighed og Styresystemer - Processer og Tråde

Principper for Samtidighed og Styresystemer - Processer og Tråde

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Hvad er resultatet af følgende pr<strong>og</strong>ram?Exampleint i = 0;void thread() {<strong>for</strong>(int j = 0; j < 10000;j++) {i++;}}t1 = run(thread);t2 = run(thread);wait(t1);wait(t2);print(i);// ofte nødvendigt <strong>for</strong> resultatPSS2011 (Forelæsning 03) <strong>Processer</strong> <strong>og</strong> Tråde Feb 2011 8 / 19

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

Saved successfully!

Ooh no, something went wrong!