Wednesday, 28 August 2013

Multithreading and oop

Multithreading and oop

I am working on a project that uses 2 different threads (th1 and th2).
They share several object and variables via the extern keyword. They are
global object and global variables
something like:
extern Obj1 *obj1;
It seems to me that:
calling a metod of obj1 in different threads;
setting a value of obj1 in different threads;
using heavily the global boolean variables like semaphores;
is not a safe way of programming, but i would like to have some reference
to proof it, like some paper or book that discourage it. Can anyone
clarify? I'm assuming that an x86 platform is being used with visual
studio c++.

No comments:

Post a Comment