[fpc-devel] threadvar implementation

Michael Van Canneyt michael at freepascal.org
Fri Aug 6 11:24:49 CEST 2010



On Fri, 6 Aug 2010, Michael Schnell wrote:

> On 08/06/2010 12:31 AM, Jonas Maebe wrote:
>> (but keep in mind that the only reason that intialising/finalising threads 
>> not started via the FPC rtl now works under Unix is exactly because every 
>> threadvar access requires a call into a helper routine).
> Of course this is why I started the thread. The C compilers seem to work more 
> efficient on that behalf and thus it might be viable to improve FPC.

How can a C compiler be more efficient, if the threadvar concept does not
exist in C ? On posix platforms, you must use a series of thread calls to 
get to your 'thread-local' variable. When accessing a thread variable, 
FPC uses the same series of calls as one would in C using pthreads.

Michael.



More information about the fpc-devel mailing list