Threads and Static Data

Sean Kelly sean at f4.ca
Thu Dec 13 07:52:13 PST 2007


Regan Heath wrote:
> 
> On the other hand if the library encapsulates all it's variables in a 
> class or struct[2] then you are free to have a separate instance of the 
> class or struct per thread, typically as a member of your thread class.

The only catch being that you would either have to pass that variable 
into all relevant calls in the library, or the library would have to 
maintain a thread-local reference to it.


Sean



More information about the Digitalmars-d mailing list