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.
A question on threads.
A question on threads.
I may look like a mule, but I'm not a complete ass.
- netmaestro
- PureBasic Bullfrog

- Posts: 8452
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
