I have dynamically allocated memory that I would like to share across threads. More specifically, I have an ACE thread pool, which I use to process requests on dynamically allocated ACE_Method_Request objects. These objects are created once at startup, and then processed throughout the system's running state (i.e. the same object is dispatched to different threads on a regular basis during system execution).
I am getting the following error:
Unhandled exception at 0xff5d7230 in Test.exe: 0xC0000005: Access violation reading location 0xff5d7230.
Btw, the dispatched objects form a hierarchy of classes. The crash seems not to occur when the code that processes the thread's request is in the parent abstract class and does not attempt to access any members from the corresponding child class. Virtual functions do not work, and I tried to use functors/function pointers to static functions defined in base classes and that does not work either.