On Tue, Nov 18, 2003 at 09:57:55 +0100, Arjan van de Ven wrote: > On Wed, 2003-11-05 at 01:51, Yao, Zhigang(Richard) wrote: > > Hi, > > > > I want to do the atomic operation ( such as i++ ) in user space, can I copy > > and include include/XXX/atomic.h directly? > > the answer is no. If you do that the operations aren't guaranteed to be > atomic (and probably arent even on x86) > > However glibc has primitives for this instead, as do helper libraries > like apr etc etc Failed to find them so far! Please, could you share with us which ones you mean. (Of course, I can do a structure with integer + pthread mutex, but it's 32 bytes against 4 and painfuly slow). ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bulb@ucw.cz> -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/