|
-
February 4th, 2012, 02:34 PM
#2
Re: Do threads have their own stack?
Threads share memory, and there's only one stack, so I would say the answer to your question is yes. I think you might run into problems with the static variable, but not the member variable. Threads all share the same program stack, but they keep track of what variables on the stack are theirs. So if you have 10 threads of the same function that all create a local variable 'x', there will be 10 'x' variables on the stack.
But as I said, I only think you'll run into problems with a static variable. It's very possible that you might not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|