[Boost-bugs] [Boost C++ Libraries] #1657: Bug in boost::threads sample

Subject: [Boost-bugs] [Boost C++ Libraries] #1657: Bug in boost::threads sample
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-02-29 05:37:34


#1657: Bug in boost::threads sample
--------------------------------+-------------------------------------------
 Reporter: morehate_at_[hidden] | Owner: anthonyw
     Type: Bugs | Status: new
Milestone: Boost 1.36.0 | Component: threads
  Version: Boost 1.34.1 | Severity: Cosmetic
 Keywords: example |
--------------------------------+-------------------------------------------
 Good day.

 Boost::threads has example "conditions.cpp" in boost\libs\thread\example
 folder.

 This sample has problems with synchronyzation between output streams:
 {{{
 void sender() {
 ...
         std::cout << "sent: " << n << std::endl; // <-- There isn't
 synchronyzation
 ...
 }
 void receiver() {
 ...
         std::cout << "received: " << n << std::endl; // <-- There isn't
 synchronyzation
 ...
 }
 }}}

 So the result of this sample looks like this:
 {{{
 received: 96
 received: sent: 97 // <--
 sent: 98
 sent: 99
 97 // <--
 received: 98
 }}}

 I think this is very strange for multithreads synchronization sample ;).

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1657>
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:49:57 UTC