Re: Class and Multi-thread safety
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Tue, 16 Oct 2007 22:40:07 +0100
Nuno Magalhaes <nunommagalhaes@xxxxxxxxxxx> wrote:
What is the difference between locking on "this" and locking on an
object inside the class? My object is never changed. What can go wrong?
Someone else can acquire a lock on it, inadvertently blocking things at
the wrong time. The more control you can exercise over what lock is
taken out when, the fewer deadlock risks you'll have.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- References:
- Class and Multi-thread safety
- From: Nuno Magalhaes
- Re: Class and Multi-thread safety
- From: Jon Skeet [C# MVP]
- Re: Class and Multi-thread safety
- From: Nuno Magalhaes
- Class and Multi-thread safety
- Prev by Date: Re: Altova XMLSPY is spyware and can screw your network
- Next by Date: Re: Performance Issues with Delegates
- Previous by thread: Re: Class and Multi-thread safety
- Next by thread: Re: Class and Multi-thread safety
- Index(es):
Relevant Pages
|