Re: [Boost-bugs] [Boost C++ Libraries] #10204: boost::lockfree:queue: g++ -fgnu-tm and -O1/2/3 flag not working

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10204: boost::lockfree:queue: g++ -fgnu-tm and -O1/2/3 flag not working
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-08-01 10:16:24


#10204: boost::lockfree:queue: g++ -fgnu-tm and -O1/2/3 flag not working
-------------------------+-------------------------------------------------
  Reporter: | Owner: timblechmann
  philipp.schoppe@… | Status: new
      Type: Bugs | Component: atomic
 Milestone: To Be | Severity: Problem
  Determined | Keywords: -fgnu-tm -O compiler flag
   Version: Boost | combination
  1.55.0 |
Resolution: |
-------------------------+-------------------------------------------------

Comment (by andysem):

 Replying to [comment:6 olli]:
> I can reproduce the error with gcc 4.8.2 - using {{{boost::atomic<>}}}
 and {{{__transaction_atomic}}} in the same app

 I don't have experience with gcc transactions, but as far as I understand
 atomic ops are not transaction safe and therefore should not be used
 inside transactions.

> > BOOST_FORCEINLINE is crucial in Boost.Atomic, it cannot be replaced
 with inline lightly.
> could you explain it why it is crucial, please

 It is commented in boost/atomic/detail/ops_gcc_atomic.hpp. In short,
 atomic<> functions must be inlined so that the compiler is able to see
 memory order arguments as constants. Otherwise it behaves as if seq_cst
 was specified.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10204#comment:7>
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:16 UTC