[fpc-pascal] Lack of 'volatile' a serious issue.

Tobias Giesen tobiasgiesen at gmail.com
Sat Dec 19 15:58:42 CET 2015


Hello,

I am interested in this problem too. My app is highly multithreaded,
working mostly with TObject descendants such as TStringList and
TCollections. I am ensuring thread safety thru CriticalSections. In fact
I have made my own TThreadSafeStringList.

I have been distributing the app with optimizations OFF because it 
didn't work with optimizations on. I only try optimizations ON once
every three to four years but quickly go back to optimizations OFF.

I optimize my code in such a way that compiler optimizations are 
not really needed, but obviously I wouldn't say no if they were 
reliable.

Could it be related to this discussion? Do optimizations make apps
less thread safe in FPC?

Cheers,
Tobias





More information about the fpc-pascal mailing list