Boost logo

Boost :

From: William Kempf (sirwillard_at_[hidden])
Date: 2000-08-31 16:43:33


--- In boost_at_[hidden], "Bill Wade" <bill.wade_at_s...> wrote:
> > From: William Kempf [mailto:sirwillard_at_m...]
>
> > You aren't suggesting that exchange is not useful, however,
> > are you? It's really the only portable way to read/write an
atomic_t
> > value. (I'm not distinguishing exchange() from get()/set()
because
> > they are equivalent functionality with different interface
> > signatures.)

[snip]

Very good explanation. (And I guess this means we can assume that
all platforms must support basic atomic read/write... I didn't think
that one through.) I learned something here. You are quite right
that on Win32 it makes no sense what so ever to use InerlockedExhange
as a get(). Interesting that every book/article/etc. I've read
suggests doing this, but that's another issue all together (you often
can't trust such books ;).

However, I still think we're just splitting hairs. Even though it
may result in an extra lock, exchange() can be used to perform
get/set. For performance reasons, yes, I can see adding get/set to
my list, but I don't think we're talking about removing anything
here. Or are we?

Bill Kempf


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