[Boost-bugs] [Boost C++ Libraries] #11049: lockfree::spsc_queue read/write_available unsafe

Subject: [Boost-bugs] [Boost C++ Libraries] #11049: lockfree::spsc_queue read/write_available unsafe
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-02-19 17:07:19


#11049: lockfree::spsc_queue read/write_available unsafe
-------------------------------+--------------------------
 Reporter: Nate C <crzftx@…> | Owner: timblechmann
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: lockfree
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
-------------------------------+--------------------------
 ringbuffer_base::read_available() and ringbuffer_base::write_available()
 both load write_index_ and read_index_ using relaxed memory order.
 read_available() should be used by the consumer, and thus should load
 write_index_ with memory_order_acquire. similarly, write_available()
 should be used by the producer, and thus should load read_index_ with
 memory_order_aquire.
 in addition, the comment for both functions is backwards, stating
 read_available() should only be called by the producer while
 write_available() should only be called by the consumer, which makes no
 sense.
 finally, the comment on front() is unclear in which thread is allowed to
 call it, but only the consumer can call front()

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11049>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC