what is object lock?



what is object lock?..

Answer / divikiran

The lock keyword marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a statement, and then releasing the lock. This statement takes the following form:

Object thisLock = new Object();
lock (thisLock)
{
// Critical code section
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

What is difference between static page and dynamic page?

0 Answers  


Explain the difference between static page and dynamic page?

0 Answers  


Why MVC programming model preferred?

1 Answers  


How do you create threading in .NET? What is the namespace for that?

2 Answers  


What is the use of activex control in .net?

0 Answers  






What is the difference between .net and laravel?

0 Answers  


Explain webfarm vs webgardens in .net?

0 Answers  


Types of JIT and what is econo-JIT ?

5 Answers   Hewitt, TCS,


Difference between Debugging and tracing in .net

1 Answers  


Which Namespace is used to to achieve MultiThreading in .NET?

0 Answers  


What are data types in .NET?

0 Answers   UGC Corporation,


Is there any thread in our .net programs?

0 Answers  


Categories