Should I use readerwriterlock instead of monitor.enter/exit?



Should I use readerwriterlock instead of monitor.enter/exit?..

Answer / Chandan Kumar Rawat

It depends on your specific use case. If you have multiple readers and a single writer accessing shared resources, a ReaderWriterLock might be more appropriate as it allows concurrent read operations while ensuring exclusive write access. However, if all threads are writing to the resource, using Monitor.Enter/Exit would suffice.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

How to implement CAS in .Net?

1 Answers   247Customer,


What is SOAP? How you will do windows and forms authentication?

1 Answers   Wipro,


What is view state?

6 Answers   TCS,


How ASP .NET different from ASP?

4 Answers  


What is connection pooling and how do you make your application use it?

1 Answers  


Can we use data reader to bind gridview?

3 Answers   TCS,


When should I use .net core?

1 Answers  


Tell us why do we use the “using” statement?

1 Answers  


differance between checkbox and rediobutton in vb.net?

1 Answers  


Explain how to spawn a thread?

1 Answers  


Describe the use of following com+ services jit activation, queued components, object pooling.?

1 Answers  


what is the default security setting in .net?

1 Answers  


Categories