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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A More Detailed Look<br />

<strong>in</strong>t b;<br />

void first(void)<br />

{<br />

list_t* q = rcu_dereference(head);<br />

}<br />

return q->a + b;<br />

Before <strong>the</strong> proposal for dependency order<strong>in</strong>g through release/consume,<br />

<strong>the</strong> <strong>the</strong>n current draft would require <strong>the</strong> use of an acquire operation <strong>in</strong><br />

<strong>the</strong> rcu_dereference.<br />

Do<strong>in</strong>g so prevents <strong>the</strong> compiler <strong>from</strong> load<strong>in</strong>g b before <strong>the</strong> execution of<br />

<strong>the</strong> rcu_dereference.<br />

A standard for a high performance language must permit extensive<br />

compiler optimization and efficient execution on modern mach<strong>in</strong>es.<br />

C11 succeeds with this — also for multicores.<br />

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

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

Saved successfully!

Ooh no, something went wrong!