[fpc-devel] Comparison FPC 2.6.2 - Delphi 7
Tomas Hajny
XHajT03 at hajny.biz
Mon Mar 4 12:29:59 CET 2013
On Mon, March 4, 2013 10:33, Michael Schnell wrote:
> On 03/04/2013 10:07 AM, Michael Van Canneyt wrote:
>>
>> We use pthreads on non-windows, and GetTLS/SetTLS on Windows.
>>
> Thus the situation is as it was when we discussed this some years ago: a
> library call with each access to a threadvar, making fpc a lot slower
> that the C compiler (Microsoft and GNU, no idea about other brands) on
> that behalf (that might nob be very relevant in real life) .
.
.
It's questionable whether it should be responsibility of a compiler to
provide efficient support for threadvars, or whether the target platform
should provide more efficient support for them in its design and its
libraries (here MS Windows API, Posix threads, etc.). The OS/2 target does
not need any API call for accessing threadvars (thanks to the OS/2 design
using "virtualization" features provided by the Intel architecture) and
there is no compiler magic involved. Admittedly, this may not scale well
to all types of CPU architectures (i.e. function call to a platform API
may be more appropriate in the end to allow simpler and more powerful CPU
architectures alike), but there is no need why the platform API should be
more complicated (i.e. slower) than the simple pointer access (as used
with the OS/2 implementation for threadvar access) on a CPU architecture
providing such features.
Tomas
More information about the fpc-devel
mailing list