Boost logo

Boost :

From: egorovv (egorovv_at_[hidden])
Date: 2002-02-28 15:19:03


--- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> From: "Vadim Egorov" <egorovv_at_y...>
> > "Peter Dimov" <pdimov_at_m...> writes:
> >
> > > From: "Steve M. Robbins" <steven.robbins_at_v...>
> > >> Hi,
> > >>
> > >> This file includes <asm/atomic.h>, apparently hoping to find
the
> > >> definition of ATOMIC_INIT(). This works on my i368 machine,
but not
> > >> on the Debian sparc or powerpc builders. Is it kernel version
> > >> dependent? If so, in what version did it appear?
> > >
> > > I don't know. I am not a Linux kernel expert by any means, and
there is
> no
> > > definitive documentation that I know of. :-(
> > >
> > > Another strong case for ./configure. (HAVE_ASM_ATOMIC_H.)
> > IMHO, using <asm/atomic.h> in an application code is a bad thing -
it was
> in
> > no way designed for that. In my configuration for example, it
depends on
> CONFIG_SMP
> > (the name differs between versions) and, since my kernel is
configured
> without SMP
> > support, does not generate atomic instructions - so the resulting
> application will
> > have a good chance to fail running on an SMP platform.
>
> You are right, I haven't thought of that; the functions are inline.
So what
> can we do? Implement our own atomic.h for every platform? Or just
use
> pthreads and live with the performance hit?
Let alone performance hit, pthreads dependency is often
not desireable and sometimes not acceptable. I would start with
gcc/i386 atomicity, I hope that other compilers/architectures will
come along.
Vadim.


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