Boost logo

Boost :

Subject: Re: [boost] Notice: Boost.Atomic (atomic operations library)
From: Helge Bahmann (hcb_at_[hidden])
Date: 2009-12-03 16:38:07


Am Thursday 03 December 2009 19:18:10 schrieb Andrey Semashev:
> Oliver Kowalke wrote:
> > I believe Helge's plan was to provide an implementation of C++-0x
> > atomics - PODs are not part of the 'atomic' interface - so I would vote
> > against PODs.
>
> My bad. I was under impression that these functions operate on integral
> types rather than classes. Sorry.

Supporting PODs is probably not possible in a portable fashion -- there may be
architectures that simply cannot read/write bytes individually (for example
Cell SPU always reads/writes 16 bytes at a time), so an "atomic" uint8_t
placed in the same word as a "non-atomic" uint8_t simply won't work (I don't
think atomic<uint8_t> is required to be one byte in size and may therefore
provide requisite "padding").

Helge


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk