How do I prevent concurrent access to my data?



How do I prevent concurrent access to my data?..

Answer / Manoj Kumar Singh

In .NET, you can use locks, semaphores, or the `ConcurrentDictionary` class to prevent concurrent access to shared data. The `lock` keyword can be used to create a lock around critical sections of your code. Concurrent collections such as `ConcurrentQueue`, `ConcurrentStack`, and `ConcurrentDictionary` provide thread-safe implementations for common collection operations.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net AllOther Interview Questions

HttpHendler and HttpModules

1 Answers   PCS, Sopra,


What is the importance of updatepanel control?

1 Answers  


Let's say I have an existing application written using Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. How would you approach migrating this application to .NET ?

1 Answers  


What is one way operation?

1 Answers  


Explain different pipelining hazards and how are they eliminated? : .NET Architecture

1 Answers  


What are end points, contract, address and bindings?

1 Answers  


Explain how does .net mobile work? : Microsoft dot net mobile

1 Answers  


How does .net mobile work? : Microsoft dot net mobile

1 Answers  


What is the difference between an event and a delegate?

1 Answers  


Is dim fs as filestreamobject is a managed code? : Dot net architecture

1 Answers  


Explain domestic architecture artifacts? : .NET Architecture

1 Answers  


Are there any third party logging components available?

1 Answers  


Categories