[fpc-devel] Why FreeBSD sem_init() works different to Linux?

Ewald ewald at yellowcouch.org
Thu Feb 7 16:52:06 CET 2013


Once upon a time, on 02/07/2013 03:11 PM to be precise, Jonas Maebe said:
> The interlocked* routines only guarantee that that particular value is
> updated in atomic way across multiple cores. It does not guarantee
> anything about memory access performed before or after that
> interlocked* call. The memory barriers are to ensure that all memory
> accesses before the lock-primitive (such as
> Enter/LeaveCriticalSection) are also synchronized across all cores.
Right, I see your point, should be documented if you ask me (like `This
call doesn't guarantee any kind of memory barrier.`). Altough I still
don't see how you can make these calls atomic then (without the
barrier)? I guess I'll have to take a peek at the source code for these
calls on different platforms/architectures...

-- 
Ewald




More information about the fpc-devel mailing list