S
sklett
I just finally found the cause of a bug I've been working on and it's a
threading issue. I have a shared resource (Image instance) that is being
manipulated in one thread and in another. I've been refreshing my multi
threading knowledge on Jon Skeet's fantastic articles (
http://www.yoda.arachsys.com/csharp/threads/ ). I need to ensure exclusive
access to this Image instance but I'm struggling with were to locate the
lock object. My application is based on the CAB framework which encourages
very lose coupling; As a result I don't have an easy way to share a lock
object between two subsystems. Or more accurately I should say I haven't
figured out a way to do it.
I'm curious how others have handled the issue of two threads in separate
classes or even assemblies that are accessing the same shared resource;
where do you place your lock objects?
Any suggestions greatly appreciated.
-SK
threading issue. I have a shared resource (Image instance) that is being
manipulated in one thread and in another. I've been refreshing my multi
threading knowledge on Jon Skeet's fantastic articles (
http://www.yoda.arachsys.com/csharp/threads/ ). I need to ensure exclusive
access to this Image instance but I'm struggling with were to locate the
lock object. My application is based on the CAB framework which encourages
very lose coupling; As a result I don't have an easy way to share a lock
object between two subsystems. Or more accurately I should say I haven't
figured out a way to do it.
I'm curious how others have handled the issue of two threads in separate
classes or even assemblies that are accessing the same shared resource;
where do you place your lock objects?
Any suggestions greatly appreciated.
-SK