[fpc-pascal] Threadvar member field

Karoly Balogh (Charlie/SGR) charlie at scenergy.dfmk.hu
Fri Mar 17 17:13:48 CET 2017


Hi,

On Fri, 17 Mar 2017, Michael Schnell wrote:

> Accessing threadvars (in fpc) costs a lot more CPU cycles (i.e. involves
> an OS call) than accessing normal variables.

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. On some platforms, threadvars are barely
slower than normal ones, other platforms have the large penalty you're
talking about. I agree though that it's still wise to count on the worst
case scenario though.

Charlie



More information about the fpc-pascal mailing list