Isolating read and write in multithreaded

Posted by the_lotus on Stack Overflow See other posts from Stack Overflow or by the_lotus
Published on 2010-03-08T15:30:27Z Indexed on 2010/03/08 15:36 UTC
Read the original article Hit count: 192

Filed under:
|
|

Hi

In a multithreaded application. I have a bunch of function that loop through a collection to read the information. I also have a bunch of function that modifies that same collection.

I’m looking for a way to isolate all the read and the write together. I don’t want a write to be done while a read is in progress. I was thinking of using SyncLock on the collection object but this will block multiple read trying to work in parallel.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about vb.net