Subj : Re: a thread question To : comp.programming.threads From : loic-dev Date : Thu May 12 2005 05:41 am Hi! > Hi I am writing a multithreads program. > I have a variable in the main thread, Do you mean, your variable is declared in the main's body? > can I use it at the child thread? To be visible from every threads, the variable must be global. > For example I have a count in main, > when the count reaches 10, I will execute some command at the child > is it OK? If you want to react when a certain predicate becomes true (here, your count reaches 10), then you might want to consider a Pthreads synchronization tool called "condition variables". HTH, Loic. .