------ art_934_5353463.1124872735789 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sometimes Thread Local Storage is a possible work around for global variable issues. With Windows you can achieve this in two different ways: - Declare a variable as thread local Say you have a global variable *int g_TheCounter;*. You can write * _declspec(thread) int g_TheCounter;*. This tells the compiler to tread the variable as thread local. - Use dynamic thread local storage There is a special API The functions (* TlsAlloc/TlsFree/TlsSetValue/TlsGetValue*). *TlsAlloc/TlsFree* Allocate an index that is used to access one thread local storage value. This index must be placed into a global variable (it is a read only value since). It is used with the *TlsSetValue/TlsGetValue * functions to modify the thread local storage variable. For more details see the Knowlede base article Q94804 "Thread Local Storage overview http://www.michaelmoser.org/tlssupp.htm ------ art_934_5353463.1124872735789--