c# Programming Glossary: readerwriterlock
ReaderWriterLock vs lock{} http://stackoverflow.com/questions/2116957/readerwriterlock-vs-lock vs lock Please explain what are the main differences and when.. only one thread to execute the code at the same time. ReaderWriterLock may allow multiple threads to read at the same time or have.. so it might be more efficient. If you are using .NET 3.5 ReaderWriterLockSlim is even faster. So if your shared resource is being read..
using statement vs try finally http://stackoverflow.com/questions/278902/using-statement-vs-try-finally might be better than another. Method 1 try finally static ReaderWriterLock rwlMyLock_m new ReaderWriterLock private DateTime dtMyDateTime_m.. 1 try finally static ReaderWriterLock rwlMyLock_m new ReaderWriterLock private DateTime dtMyDateTime_m public DateTime MyDateTime get.. finally rwlMyLock_m .ReleaseWriterLock Method 2 static ReaderWriterLock rwlMyLock_m new ReaderWriterLock private DateTime dtMyDateTime_m..
Update a ObservableCollection with a background worker in mvvm http://stackoverflow.com/questions/3628477/update-a-observablecollection-with-a-background-worker-in-mvvm dispatcher Dispatcher.CurrentDispatcher rwLock new ReaderWriterLock protected override void InsertItem int index T item if dispatcher.CheckAccess..
Conditional compilation depending on the framework version in C# http://stackoverflow.com/questions/408908/conditional-compilation-depending-on-the-framework-version-in-c-sharp which allow something like #if CLR_AT_LEAST_3.5 use ReaderWriterLockSlim #else use ReaderWriterLock #endif or some other way to do.. #if CLR_AT_LEAST_3.5 use ReaderWriterLockSlim #else use ReaderWriterLock #endif or some other way to do this c# preprocessor conditional..
Static Generic Class as Dictionary http://stackoverflow.com/questions/686630/static-generic-class-as-dictionary static Action T GetMethod T In production code this would ReaderWriterLock Delegate method if methods.TryGetValue typeof T out method methods.Add..
|