06.08.2013 Views

Threads in the new ISO C Standard from 2011

Threads in the new ISO C Standard from 2011

Threads in the new ISO C Standard from 2011

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

The C11 Memory Consistency Model for Non-Atomic<br />

Objects<br />

Initially some <strong>in</strong> <strong>the</strong> standardization committee wanted to standardize<br />

on sequential consistency.<br />

Fortunately, C11 has standardized on a relaxed memory model for<br />

non-atomic objects.<br />

This is partly based on <strong>in</strong>put <strong>from</strong> L<strong>in</strong>ux kernel developers.<br />

Thus, to make an assignment visible to ano<strong>the</strong>r thread requires<br />

synchronization between <strong>the</strong> writ<strong>in</strong>g and read<strong>in</strong>g threads.<br />

There are three ma<strong>in</strong> k<strong>in</strong>ds of synchronization and we will start with<br />

mutex unlock/lock.<br />

Jonas Skeppstedt (js@cs.lth.se) Lecture 6 2013 21 / 70

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

Saved successfully!

Ooh no, something went wrong!