Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-08-20 11:10:05


From: "Alexander Terekhov" <terekhov_at_[hidden]>
> > As it stands, to make shared_ptr thread safe, I have to roll my own
> > atomic_t.
>
> for windows/IA32 maybe.. however, consider that AFAICT IA64
> version of ref.counter decrement function should use cmpxchg.rel
> (but not cmpxchg.acq) instruction and on the other hand IA64
> version of {spin}lock.acquire function should use cmpxchg.acq
> (but not cmpxchg.rel) instruction. do you have any ideas
> whether Interlocked*/IA64 really provide required memory
> ordering semantics (basically bidirectional memory fence,
> to be safe)? i do not..

Well that's Microsoft's problem, is it not. They'll do whatever needs to be
done to make Interlocked* work on win64 (or win32/IA64, or win64 in win32
compatibility mode, or whatever.) And if they don't, boost::atomic_t will
simply fall back to the mutex solution.

I don't see a reason to not use Interlocked* on win32.

--
Peter Dimov
Multi Media Ltd.

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