07.01.2013 Views

David Defour - Université de Perpignan

David Defour - Université de Perpignan

David Defour - Université de Perpignan

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Arbitrating Contention for Shared<br />

Resources<br />

• Synchronizing a section of co<strong>de</strong><br />

synchronized(someObject) {<br />

co<strong>de</strong><br />

}<br />

• Simplistic interpretation<br />

–Once a thread enters the co<strong>de</strong>, no other thread can enter until<br />

the first thread exits.<br />

• Stronger interpretation<br />

720<br />

jeudi 26 janvier 12<br />

–Once a thread enters the co<strong>de</strong>, no other thread can enter any<br />

section of co<strong>de</strong> that is synchronized using the same “lock”<br />

object<br />

• If two pieces of co<strong>de</strong> say “synchronized(blah)”, the question is if<br />

the blah’s are the same object instance.

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

Saved successfully!

Ooh no, something went wrong!