Boost logo

Boost :

From: jpanzer_at_[hidden]
Date: 2000-08-09 21:02:28


Dietmar Kuehl wrote:

> Hi,
> --- jpanzer_at_[hidden] wrote:
> > This is my worry. I don't see any obvious way around having to
> > use a single, global mutex to implement operations like
> > "atomic_incr(i)", where the caller does not supply a mutex.
>
> Well, it depends what type 'i' has: If it does not have type 'int' but
> rather something like 'atomic_traits<int>::type' there is an obvious
> place where the necessary mutex can be located for implementations not
> supporting atomic type: In the object 'i'. Of course, on platforms
> supporting atomic operations, 'type' might very well be 'int'...

Ah! And clients can provide specializations for their own types if
desired. Well, now it is obvious. And elegant. :^)

John Panzer


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