[fpc-pascal] Threadvar member field

Michael Schnell mschnell at lumino.de
Mon Mar 20 10:16:19 CET 2017

On 17.03.2017 17:13, Karoly Balogh (Charlie/SGR) wrote:
> This is actually entirely platform specific. The underlying 
> implementation of threadvars is very different for each platform, and 
> highly depends both on the CPU arch and the OS.
That might be true.

Last time I checked (several years ago), the fpc implementations did OS 
calls when accessing thread vars with X86 architecture for Windows. This 
is not necessary.  All C compilers I checked don't do this, but use a 
dedicated segment register, even though this (at that time) was not 
documented by Microsoft. Linux C compilers use a dedicated Segment 
register, as well, here its a regular documented feature of the OS. (I 
don't remember what fpc did for Linux at that time.)

Hopefully 64 bit platforms are better (and decently documented) on that 

No idea about ARM etc.


More information about the fpc-pascal mailing list