On 24 June 2010 09:00, Michael Schnell <[email protected]> wrote: > On 06/23/2010 09:26 PM, Florian Klämpfl wrote: >> I'am sure if it's a problem for somebody, he will find a solution and >> send a patch. >> > As the swap instruction seems to be the only atomic memory operation ARM > lower than v6 can do, there is no possible workaround in user space > software.
Not without kernel support, see here: http://www.eglibc.org/cgi-bin/viewcvs.cgi/trunk/ports/sysdeps/arm/bits/atomic.h?rev=77&view=markup Note the comment: /* Atomic compare and exchange. These sequences are not actually atomic; there is a race if *MEM != OLDVAL and we are preempted between the two swaps. However, they are very close to atomic, and are the best that a pre-ARMv6 implementation can do without operating system support. LinuxThreads has been using these sequences for many years. */ The linux specific code is here: http://www.eglibc.org/cgi-bin/viewcvs.cgi/trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h?rev=3063&view=markup It relies completely on the kernel. Henry _______________________________________________ fpc-devel maillist - [email protected] http://lists.freepascal.org/mailman/listinfo/fpc-devel
