I am developing a shared library(.so) and dll. I have a global variable which is updated in multiple threads. So I have mutex lock for synchronization.
By default, no, global variables are not shared across processes.
However, you can use a data segment (data_seg) in order to share global variables across processes. You can find more information on MSDN in the article titled "How do I share data in my DLL with an application or with other DLLs?"