I'm putting together a parallel program in pthreads. I'm still kind of new to c-syntax, but is it true that a variable declared outside main() is global? Or is there more to it..?
The problem with global data is the same problem as with public class members - the access is unrestricted. You should at least restrict the access to make it easier to refactor your code.
L B - The whole point is to make it accessible. As long as I lock the variable when a thread is thinkering with it i should be safe. You know pthread_mutex_lock() etc.
Thanks for your concern!
Disch - Not sure but it seems you mixed up the concept of tedious and big trouble. ;-)