Michael Van Canneyt schrieb:

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.

IMO there exists no requirement, that POSIX threadvars are accessible in Pascal. So FPC could use the Windows scheme for its own threadvars, where the OS only provides the address of an thread-specific memory block - equivalent to 1 POSIX "thread-local" variable. The referenced memory blocks, one per thread and containing all the Pascal threadvars, can be allocated on the heap.

DoDi

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to