views:

148

answers:

2

Possible Duplicate:
Is global variable in a shared library / dll, shared across process

Hi stackoverflow, I have just a little question about using .so in C programming. I want to use static and global variables in a shared library. If this library is loaded and used by several processes, will these processes share the global variables (i.e. will a process be able to modify variables used by an other process)? Anyone got an idea about the behavior of these variables ?

+1  A: 

will these processes share the global variables

No.

KennyTM
+1  A: 

No, global variables are global inside a process. If you want to share data among processes you have to use specific IPC (inter-process communication) mechanisms.

mouviciel