Locking individual elements in a static collection?

Posted by user638474 on Stack Overflow See other posts from Stack Overflow or by user638474
Published on 2011-02-28T23:16:17Z Indexed on 2011/02/28 23:24 UTC
Read the original article Hit count: 156

Filed under:
|
|

I have a static collection of objects that will be frequently updated from multiple threads. Is it possible to lock individual objects in a collection instead of locking the entire collection so that only threads trying to access the same object in the collection would get blocked instead of every thread?

If there is a better way to update objects in a collection from multiple threads, I'm all ears.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about ASP.NET