[fpc-devel] Comparison FPC 2.6.2 - Delphi 7

Florian Klaempfl florian at freepascal.org
Wed Mar 6 11:45:02 CET 2013


Am 06.03.2013 11:12, schrieb Michael Schnell:
> So (as with all x86 variants) no library
> or system call is necessary.

Wrong. This is not true in the general case, please read the appropriate 
api documents.

>
> With Cortex, this has changed to the use of the CP15 Register (freeing
> A9 to allow for better optimization). Now, CP15 is in fact not very
> suitable for this purpose, as it can only be accessed with privileged
> instructions and thus not in user mode (where the TLS in fact is
> invented for).Thus a system call (or trap) is needed to get the address
> of a threadvar.

Wrong. On linux this can be done by a jump to a certain adress.

> Conclusion:
>
> With FPC, the optimization of threadvar access is not necessary. Instead
> it is highly recommended to always use thread specific instances of the
> classes that do the threaded work. TThread of course provides this out
> of the box.
>

And how does one the "current" TThread?




More information about the fpc-devel mailing list