[Lazarus] thread safe
Henry Vermaak
henry.vermaak at gmail.com
Tue Jun 28 12:16:35 CEST 2011
On 28/06/11 10:22, Henry Vermaak wrote:
> 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.
http://msdn.microsoft.com/en-us/library/ms686355%28v=VS.85%29.aspx
confirms this.
Henry
More information about the Lazarus
mailing list