R
Rainer Queck
Hi NG,
what would be the easiest way to make a generic list thread safe?
Thanks for hints and help!
Rainer
what would be the easiest way to make a generic list thread safe?
Thanks for hints and help!
Rainer
Rainer Queck said:... hm.... Monitor.Enter and .Exit should do this job, right?
will allow multiple reads without blocking...
Anders Borum said:Although it is slower .. (atleast to my understanding and performance
tests).
Nicholas Paldino said:While yes, in practice this ^should^ be true, it is not. There is a
problem with the current implementation of ReaderWriterLock in that the
performance is horrible (I personally have tested it and in areas of high
contention, found that it is 6-7 times slower than using Monitor/lock).
Apparently, Jeffery Richter (from Wintellect) has addressed this in his
own implementation of ReaderWriterLock, which he patented, and subsequently
sold to MS. There is a description here:
http://wesnerm.blogs.com/net_undocumented/2005/04/index.html
Nicholas Paldino said:I tried a number of situations, with 10 and 100 threads each working
concurrently, weighing the operations (read/write) in a balanced way, vs
more reads vs more writes.
It's horrendously slow EVERY time.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.