Click here to Skip to main content
15,905,967 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMakefiles Pin
^GeeK^29-Oct-01 19:51
^GeeK^29-Oct-01 19:51 
Generalabout Font Pin
Maer72729-Oct-01 19:46
Maer72729-Oct-01 19:46 
GeneralRe: about Font Pin
Christian Graus29-Oct-01 23:24
protectorChristian Graus29-Oct-01 23:24 
GeneralRe: about Font Pin
Maer72729-Oct-01 23:47
Maer72729-Oct-01 23:47 
GeneralRe: about Font Pin
Jonathan de Halleux30-Oct-01 0:32
Jonathan de Halleux30-Oct-01 0:32 
GeneralRe: about Font Pin
Maer72731-Oct-01 1:34
Maer72731-Oct-01 1:34 
Generalabout "TLS" Pin
Maer72729-Oct-01 19:28
Maer72729-Oct-01 19:28 
GeneralRe: about "TLS" Pin
Steen Krogsgaard29-Oct-01 22:20
Steen Krogsgaard29-Oct-01 22:20 
Basically, you're right. The TLS slot alloated in A2 is useless if A2 does not use the same data items as A1.

The reason for this is this. Suppose you want to save the creation time for each thread in your process. And for the sake of completeness we can do the saving in a DLL. When the DLL loads it calls TlsAlloc and saves the returned index in a global variable (e.g. g_iTlsIndex). Now, as each thread is created it can save the creation time in the TLS slot with index g_iTlsIndex - the same index but a unique memory location for each thread. Of course, if your threads are totally unrelated and does totally different things they will probably not have the need for common TLS indices. But you got at least 64 TLS slots available, so you can use new one for each thread type.

TLS, DLLs and multithreading programming is described in great detail in Richters "Advanced Windows". I for (i=0; i<A_WHOLE_LOT;i++, printf("really ")); recommend you get a copy if you're doing MT programming. It's worth every dime.

Cheers
Steen.

"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
GeneralRe: about "TLS" Pin
Steen Krogsgaard29-Oct-01 22:23
Steen Krogsgaard29-Oct-01 22:23 
GeneralRe: about "TLS" Pin
Maer72731-Oct-01 1:53
Maer72731-Oct-01 1:53 
GeneralHandling system color change in OpenGL apps. Pin
v_krishnan29-Oct-01 19:07
v_krishnan29-Oct-01 19:07 
GeneralDialogs inside MDI Pin
Christopher Lord29-Oct-01 18:40
Christopher Lord29-Oct-01 18:40 
GeneralRe: Dialogs inside MDI Pin
Steen Krogsgaard29-Oct-01 22:26
Steen Krogsgaard29-Oct-01 22:26 
GeneralAbout "Ctrl + ALT + DEL" Pin
29-Oct-01 18:33
suss29-Oct-01 18:33 
GeneralRe: About "Ctrl + ALT + DEL" Pin
Michael Dunn29-Oct-01 21:23
sitebuilderMichael Dunn29-Oct-01 21:23 
GeneralRe: About "Ctrl + ALT + DEL" Pin
29-Oct-01 22:22
suss29-Oct-01 22:22 
GeneralRe: About "Ctrl + ALT + DEL" Pin
2-Nov-01 14:01
suss2-Nov-01 14:01 
GeneralRe: About "Ctrl + ALT + DEL" Pin
Deepak Khajuria29-Oct-01 22:03
Deepak Khajuria29-Oct-01 22:03 
GeneralText To Speech Control...... Pin
29-Oct-01 18:31
suss29-Oct-01 18:31 
GeneralRe: Text To Speech Control...... Pin
Michael P Butler30-Oct-01 2:30
Michael P Butler30-Oct-01 2:30 
GeneralMake/Compile file problem Pin
29-Oct-01 16:02
suss29-Oct-01 16:02 
GeneralScrollbar question with RichEditControl Pin
gordingin29-Oct-01 15:10
gordingin29-Oct-01 15:10 
GeneralCListCtrl question (custom) Pin
29-Oct-01 14:39
suss29-Oct-01 14:39 
GeneralRe: CListCtrl question (custom) Pin
Tomasz Sowinski30-Oct-01 0:48
Tomasz Sowinski30-Oct-01 0:48 
QuestionWindow minumim width ? Pin
Christian Graus29-Oct-01 13:15
protectorChristian Graus29-Oct-01 13:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.