On 27/06/11 23:31, Andrew Brunner wrote:

2.) Execution Order.  A critical section does not protect or ensure
that code will be executed in any particular order.  This is where

How do you know this? Unfortunately I can't read the code for the Windows critical sections and the documentation doesn't explicitly state anything, but at least pthread mutex guarantees a memory barrier. So if you're using the fpc rtl critical sections on unix (which uses pthread_mutex), your statement is false.

You'll have to read the generated assembler for Windows critical sections. My hunch would be that they use memory barriers, too.

Henry

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to