A question on threads.
Posted: Mon Jul 17, 2006 3:19 pm
				
				I was just contemplating threads and what it means exactly to be threadsafe?
One question to the enlightened masses! If two threads, for example, both call the same procedure within the main application (I assume this is possible?) and assuming they each get their own local variables, what happens in the case of static variables?
Specifically, suppose thread A calls procedure Test() and sets static variable 'StaticByte' to equal 10.
Thread B now calls Test(). Will 'StaticByte' hold the value of 10?
Sorry if it's a dumb question, but I have little experience with threads.
I guess I could try it out, but I'm away from my Purebasic machine at the moment.
Thanks.
			One question to the enlightened masses! If two threads, for example, both call the same procedure within the main application (I assume this is possible?) and assuming they each get their own local variables, what happens in the case of static variables?
Specifically, suppose thread A calls procedure Test() and sets static variable 'StaticByte' to equal 10.
Thread B now calls Test(). Will 'StaticByte' hold the value of 10?
Sorry if it's a dumb question, but I have little experience with threads.
I guess I could try it out, but I'm away from my Purebasic machine at the moment.
Thanks.
