I have a dll, which is loaded by the couple of processes. In that DLL source code I have an instance of global variable. Will this global variable be the same in all loaded processes ? Or will it be as the unique variable in each process ?
Asked
Active
Viewed 84 times
1
unresolved_external
- 1,892
- 4
- 28
- 62
-
Only the code is shared between processes. – Hans Passant Dec 09 '13 at 16:04
-
Pretty sure it'd be unique to each process. – Danny Beckett Dec 09 '13 at 16:04
-
Normally it will be unique, though there are ways of making it shared. In Win16 they are shared though. – doynax Dec 09 '13 at 16:05
-
http://stackoverflow.com/a/17700531/11683 – GSerg Dec 09 '13 at 16:05
-
Each process should have its own copy of the variable. But you can make sure of that with a small test program that shouln't take more than 5 minutes to write. – Guntram Blohm Dec 09 '13 at 16:06
-
@Bathsheba - language is irrelevant, it is *operating system* which matters. – Chris Stratton Dec 09 '13 at 16:15
1 Answers
2
It will be unique to each process, unless (i) you've written explicit code to share inter-process or (ii) are still using a 16 bit dll.
Bathsheba
- 227,678
- 33
- 352
- 470