Boost C++ Libraries: Ticket #7403: lockfree support in MSVC 2012 https://svn.boost.org/trac10/ticket/7403 <p> Hi, </p> <p> MSVC 2012 has atomics; it therefore allows boost.lockfree to be used with it. </p> <p> Using boost.atomic on MSVC is not an option because it falls back to interlocked functions (not lock-free). </p> <p> Here is a simple patch for lockfree's atomic.hpp showing the necessary changes: </p> <ul><li>don't define BOOST_LOCKFREE_NO_HDR_ATOMIC in order to use &lt;atomic&gt;, not &lt;boost/atomic.hpp&gt;. </li><li>remove the (<span class="underline">cplusplus &lt; 201103L) check because </span>cplusplus is defined to 199711 on MSVC 2012... </li></ul><p> There is an additional change in freelist.hpp: include &lt;boost/cstdint.hpp&gt; (it was being included by &lt;boost/atomic.hpp&gt;). </p> <p> With these changes lock-free lists seem to be working fine! :) (I verified that is_lock_free() does return true.) </p> <p> Feel free to adjust the patch of course; this is just to show what is required to make boost.lockfree truly lock-free on MSVC 2012. I'm available for any further questions. </p> <p> Thanks for adding atomic &amp; lockfree. :) Zouzou </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7403 Trac 1.4.3 Zouzou <internet@…> Fri, 21 Sep 2012 18:28:44 GMT attachment set https://svn.boost.org/trac10/ticket/7403 https://svn.boost.org/trac10/ticket/7403 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">msvclockfree.patch</span> </li> </ul> <p> Patch </p> Ticket timblechmann Fri, 21 Sep 2012 19:38:58 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7403#comment:1 https://svn.boost.org/trac10/ticket/7403#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> applied to trunk, thanks for the patch! </p> Ticket