Subj : Re: a thread question To : comp.programming.threads From : David Schwartz Date : Thu May 12 2005 06:46 pm "Chris Thomasson" <_no_damn_spam_cristom@_no_damn_comcast.net_spam> wrote in message news:KI-dnUIImY33Lx7fRVn-ig@comcast.com... >>> To be visible from every threads, the variable must be global. >> Nope. All variables are visible to all threads. > void* thread_a( void *s ) > { > int a_local; > > return 0; > } > > > void* thread_b( void *s ) > { > int b_local; > > return 0; > } > > > void* thread_c( void *s ) > { > /* > > How could this thread modify and/or read a_local and/or b_local? > > */ > > return 0; > } The same way any other thread could. How would 'thread_b' access it? Simple -- it finds out its address some how and dereferences that. Now it's easier for threads 'a' and 'b' to do it, but certainly possible for thread c to do it. You've simply set up a case where thread c *does* *not* access the variables. However, it easily could. DS .