sgonepudi
March 6th, 2006, 08:47 AM
I have a DLL. It exports only one function.
Example Code:
extern "C" void Test()
{
abc ob1 = new abc();
ob1->xyz();
delete ob1;
}
I have created a dialog box client with multiple threads.
Each thread, checks whether the DLL loaded or not, if not loads the dll and calls the exported function.
Here my question is, in the exported function I am allocating memory for abc class. Each thread was accessing this exported function, means each thread allocates memory for abc class in his own address space or not? If it is right means every thread having different abc class instance.
i think here thread synchronization is not required becuase each thread having different instances.
If any body knows about this please explain how dll behaves in multithread client exe application.
Example Code:
extern "C" void Test()
{
abc ob1 = new abc();
ob1->xyz();
delete ob1;
}
I have created a dialog box client with multiple threads.
Each thread, checks whether the DLL loaded or not, if not loads the dll and calls the exported function.
Here my question is, in the exported function I am allocating memory for abc class. Each thread was accessing this exported function, means each thread allocates memory for abc class in his own address space or not? If it is right means every thread having different abc class instance.
i think here thread synchronization is not required becuase each thread having different instances.
If any body knows about this please explain how dll behaves in multithread client exe application.