There is no such problem. You can combine both concepts in many different ways as they are not directly related. I would rather say, inheritance (more exactly, OOP), can help multithreading very well. This question lacks subject, really.
For an essential example of use of OOP with multithreading, take a look at my past solutions:
http://www.codeproject.com/Answers/155852/How-to-pass-ref-parameter-to-the-thread#answer2[^],
change paramters of thread (producer) after it started[^].
You can abstract out different aspects of the ThreadWrapper
, such as Body
by making them virtual function (don't forget to make it protected) and produce several concrete thread wrapper classes sharing the same code, without redundant access to the common fundamental behavior.
As to the problem of sharing of any objects between threads, this problem has nothing to do with OOP; a proper synchronization should be applied to access to any objects, even the primitive ones. Different kind of locks should be used, the simplest one being the
lock
statement, see:
lock Statement (C# Reference).
—SA