24.10.2013 Views

Using Kilim's isolation types for multicore efficiency

Using Kilim's isolation types for multicore efficiency

Using Kilim's isolation types for multicore efficiency

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Multi-core and sequential consistency<br />

On a single-core (implementing tasking using interrupts) the<br />

instructions in each thread are interleaved.<br />

volatile int x=0,y=0;<br />

thread1: { x=1; print "y=",y; }<br />

thread2: { y=1; print "x=",x; }<br />

For most executions this program prints x=0, y=1 or x=1, y=0;<br />

• relatively rarely it prints x=1, y=1;<br />

• but it never prints x=0, y=0.<br />

UNIVERSITYOF<br />

CAMBRIDGE<br />

But on multi-core x=0, y=0 can happen! Not all executions interleave<br />

instructions from the two threads (they do on a single-core processor<br />

with interrupt-driven scheduling). Failure of sequential consistency.<br />

<strong>Using</strong> Kilim’s <strong>isolation</strong> <strong>types</strong> <strong>for</strong> <strong>multicore</strong> <strong>efficiency</strong> 11 FoVeOOS’2011

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

Saved successfully!

Ooh no, something went wrong!