Software job search
.net sql interview questions
  The best place for technical interview questions

 
Home.netSql serverAsp.netC#Vb.netAdo.netAjaxMcpd dumpsWord count tool
.net threading interview questions
 
Question 19   What is a monitor object

Monitor class is used to establish thread synchronization.

monitor class has to methods enter() and exit() which uses an object as a parameter. monitor ensures that a particular block of code is executed only by one thread at a time.

lock statement is a shortcut monitor. monitor provides some more operations like wait(),pulse() compared to a lock statement



Question 20   What are wait handles

Wait handles are also used to establish thread synchronization.

compared to other lock mechanisms, a wait operations happens based on events. when a thread calls waitone(), it will wait till an another thread calls set(). there are two wait handlers 1) autoresetevent , manualresetevent




Question 21   What is manualresetevent and autoresetevent

In autoresetevent when set() is called only one waiting thread is allowed to resume its operation.
but in manualresetevent when set() is called it allows all the waiting threads to resume.



Question 22   What is readerwriter locks

Compared to the other locking classes/mechanisms readerwriterlock will allow to read the value of a resource simultaneously by multiple threads. but it will lock the object while trying to change its value.
readerwriterlock will perform better since it reduces the wait during reading



Question 23   How can you avoid deadlock in threading

We can prevent deadlock in threading by using the below methods

1) lock
2) monitor
3) interlocked classes
4) wait handlers



 Rate this page
     
 22 votes , average 4 out of 5
1 2 3 4 

Reader's opinions -

No comments
Loading

 
.net interview questions
Asp.net interview questions
C# interview questions
Vb.net interview questions
Ado.net interview questions
Ajax interview questions
Wcf interview questions
Wpf interview questions
.net threading interview questions
.net remoting and webservices interview questions
.net caching interview questions
.net oops interview questions
Sharepoint interview questions
Jquery interview questions
Silverlight interview questions
Linq interview questions
Wwf interview questions
Java interview questions
Sql server interview questions
Ssis interview questions
Ssrs interview questions
Data warehousing interview questions
Data mining interview questions
Oracle interview questions
Php interview questions
Design patterns interview questions
Uml interview questions
Mcpd dumps
Pmp practice tests

This site is best viewed with Internet Explorer 7.0 or higher, Firefox 2.0 or higher, Chrome at a minimum screen resolution of 1024x768.
A complete solution to interview questions
free matrimonial website      
web hosting plans |  compare vps hosting plans |  Compare dedicated hosting plans |  Compare linux hosting plans |  Compare cloud hosting plans |  Compare windows hosting plans | 
Hosting reviews |  GoDaddy reviews | 
Support Wikipedia