[ag-automation] application layer use cases for fieldbus stack

Robert Schwebel r.schwebel at pengutronix.de
Wed Jul 11 14:38:20 CEST 2007


On Wed, Jul 11, 2007 at 01:42:25PM +0200, Peter Soetens wrote:
> The boost C++ library (boost::shared_ptr) uses atomic increment logic,
> and offers its own implementation for each architecture (see:
> boost/detail/sp_counted_base_*.hpp).

Hmm, they directly implement it in assembler. Bad for portability. But
ok, one could provide a simple lock() do_something() unlock()
implementation, for other architectures.

> Somehow, some glibc people decided that atomics/CAS did not belong in
> userspace and are removing it from the libc headers. I don't
> understand why, it's just another assembler instruction.

Drepper says no:
http://ecos.sourceware.org/ml/libc-alpha/2005-06/msg00121.html

Do you have experience with what gcc provides here:
http://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Atomic-Builtins.html#Atomic-Builtins

> Orocos has also its own CAS implementations, mapping to x86, x86_64
> and powerpc.

We would at least need fast implementations for x86, x86_64, powerpc,
arm v5 and v6 and maybe mips. And, until now, notice that there is no
reason why the libs shouldn't compile for win32 as well, so it should
also be possible there.

All in all, I'm not too happy with non-portable implementations.

Robert
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9



More information about the ag-automation mailing list