"Thomas Heller" <thomas.heller@ion-tof.com> writes:
> Can't you at least partly combine the advantages of 1 and 2 by using
> thread local storage for the global variable? I have no idea if there
> is a portable way to do this...
That would work, but, as you already guess: there is no portable way
to do this. If you can accept platform-specific code, this is a good
idea.
Regards,
Martin