|
Boost : |
From: Matt Hurd (matt.hurd_at_[hidden])
Date: 2004-09-20 08:04:00
On Mon, 20 Sep 2004 15:48:59 +0300, Peter Dimov <pdimov_at_[hidden]> wrote:
> Matt Hurd wrote:
> >> On Mon, 20 Sep 2004 15:17:43 +0300, Peter Dimov <pdimov_at_[hidden]>
> >> wrote:
> >>
> >> But why is a concurrent-aware setter useful if its effects aren't
> >> visible to the other threads?
> >
> > In what way do you mean they not visible?
> >
> > Such aligned memory operations are guaranteed to be atomic on ia32 at
> > a system wide level AFAIK.
>
> On IA32, sure, but not on other architectures.
Yup. Which gets back to the subject line... What might be the best
way to structure such things in boost for platform specific features.
For example, Apache used to have ifdef hell and changed to separate
files for platforms. This has pros and cons. Loki's current code
base uses a reference implementation with platform specific overrides
via headers. Boost has a bit of a mix of both approaches, I was just
wondering on the best way to tackle it. Perhaps, like most things,
there isn't a best, but its just a judgement call on a case by case
basis.
In that case, if boost were to have a thing such as
boost::needs_lock<T> , what would be the best way to structure the
code for the platform specifics. This seems to be beyond the normal
compiler specific identity from config.hpp, or is it?
Regards,
Matt Hurd
matthurd_at_[hidden]
www.hurd.com.au
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk