If I have two threads running the same function are local variables with the function private for each thread?
Announcement
Collapse
No announcement yet.
Threads and Local Variables
Collapse
X
-
Yes.
------------------
Perfect Sync: Perfect Sync Development Tools
Email: mailto:[email protected][email protected]</A>
"Not my circus, not my monkeys."
-
Brent,
When you use a LOCAL variable, it is allocated in a section of memory called
the stack. This allocation takes place as the function/sub is called and it
is deleted when the function/sub is finished so it simply does not exist
anywhere else when the function/sub is not running.
If you need to have a value that is available across diferent functions, use
a GLOBAL variable that can be "seen" from diferent aprts of your code.
Regards,
[email protected]
------------------
hutch at movsd dot com
The MASM Forum - SLL Modules and PB Libraries
http://www.masm32.com/board/index.php?board=69.0
Comment
Comment