[Boost-bugs] [Boost C++ Libraries] #8560: [lockfree] spsc_queue capacity one off

Subject: [Boost-bugs] [Boost C++ Libraries] #8560: [lockfree] spsc_queue capacity one off
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-05-10 16:25:15


#8560: [lockfree] spsc_queue capacity one off
----------------------------------+-----------------------------------------
 Reporter: reakinator@… | Owner: timblechmann
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: lockfree
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: |
----------------------------------+-----------------------------------------
 This is related to ticket #8135

 Should boost::lockfree::spsc_queue also be allocating one extra node to
 account for it's internal marker? Please consider the following simple
 example:

 {{{
 #include <iostream>
 #include <boost/lockfree/spsc_queue.hpp>

 int main()
 {

     boost::lockfree::spsc_queue<float> que( 3 );

     std::cout << std::boolalpha;

     std::cout << que.push(1) << std::endl; // true
     std::cout << que.push(2) << std::endl; // true
     std::cout << que.push(3) << std::endl; // false <--- should be true?
     std::cout << que.push(4) << std::endl; // false

     return 0
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8560>
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:13 UTC