Loading the same DLL instance into multiple processes

Lib1 [dll]
{
class A
{
static int i = 0;
}
}

Program1 [exe] have reference to Lib1
{
 Class b
 {
    main ()
    {
      Ai = 5;
    }
 }
}

Program2 [exe] have reference to Lib1
{
 Class c
 {
    main ()
    {
      Ai = 5;
    }
 }
}

If Program1 and Program2 are running at the same time, is it possible that they refer to the same instance of Lib1 and the change made to the static variable Ai in Program1 is available for Program2 and vice versa,

+3
source share
1 answer

, , , , . (Windows, Linux ..) , . , , DLL, , , .

, , , , . Windows , , , . , , , .

, , . - , - , , , mutex .

+8

All Articles