Boost C++ Libraries: Ticket #8666: boost::lockfree::spsc_queue::emplace_push https://svn.boost.org/trac10/ticket/8666 <p> It would be nice to be able to write the following function: </p> <pre class="wiki">void producer_thread() { while(isRunning) { T&amp; item = q.emplace_write(); // This feature avoids the need to create the item write(item); q.emplace_push(); // This feature avoids the need to copy the item } } </pre><p> Implementing this: A slow consumer may be reading the item after the write index so the change is not as easy as exposing the next item. The change would require a gap of 1 item to always exist to avoid a read/write collision. </p> <p> Jason Aubrey </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8666 Trac 1.4.3 timblechmann Sat, 08 Jun 2013 05:29:30 GMT <link>https://svn.boost.org/trac10/ticket/8666#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8666#comment:1</guid> <description> <p> to be honest, i'm not a big fan of this API. first, i don't know, if this is a real-world bottle-neck and if so, it should probably be wrapped into a Functor API for safety reasons. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 08 Jun 2013 16:12:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8666#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8666#comment:2</guid> <description> <p> Thanks for the feedback. I agree with the safety concern. </p> <p> The idea came to me when I was looking to avoid creating another container for an object store. But it's not a big hassle to do so and then pass pointers through the queue. </p> <p> Feel free to close the issue. </p> </description> <category>Ticket</category> </item> </channel> </rss>