Do thread queues affect non-thread objects in the same class?
If I create a thread with ThreadPool.QueueUserWorkItem and that thread is not referencing an object that is not thread safe, could it compromise that non thread safe object?
[Edit] Unsafe object with thread, I mean a third party interface to a programmable logic controller that has no ability to open concurrent connections or maintain concurrency.
I suppose I just wanted to make sure that by queuing threads in the same class as my reference to that object, I would not in any way compromise thread safety in a way that I did not understand.
a source to share
As long as the new thread does not directly or indirectly refer to the non-thread safe object, it will not affect it.
A small technical point. Calling ThreadPool.QueueUserWorkItem does not necessarily spawn a new thread. Instead, it ensures that the provided delegate will run on a different thread. This could result in a thread being created, or most likely it will use an existing thread that is already allocated to the thread pool.
a source to share