|
Boost : |
From: Vadim Egorov (egorovv_at_[hidden])
Date: 2002-02-28 13:46:29
"Peter Dimov" <pdimov_at_[hidden]> writes:
> From: "Steve M. Robbins" <steven.robbins_at_[hidden]>
>> 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.
I think that atomic operation are worth to be included into boost's public interface
somewhere (Boost.Trheads?) and implemented for supported platforms where possible.
Then atomic counter and spinlock mutex would be implemented on the top of that.
I have a rough patch for gcc/i386 i'm going to submit after some cleaning up.
-- Thanks, Vadim _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk