[fpc-devel] volatile variables

Nikolai Zhubr n-a-zhubr at yandex.ru
Thu Jun 30 11:04:18 CEST 2011


30.06.2011 13:31, Hans-Peter Diettrich:
> If so, would it help to enclose above instructions in e.g.
> Synchronized begin
> update the links...
> end;
If by such hypothetical "synchronized" operator you mean just memory 
barriers and nothing else, then AFAICS this would not be of much use in 
practice, because in case of strictly one thread barriers are unneeded 
anyway, and in case of 2 or more threads barriers are typically 
insufficient (because most of the time threads would also need race 
protection, which is not provided by barriers alone).
If what you mean here is rather a full-blown critical section with just 
some more elegant and generic syntax (i.e. a replacement of 
EnterCriticalSection/LeaveCriticalSection a la java), then yes, it might 
be nice, but mostly aesthetic-wise.

Nikolai



More information about the fpc-devel mailing list