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 interview questions
Question 61   How can we know a state of a thread

Thread.threadstate property gives the information about threads current state

Question 62   What is use of interlocked class

Interlocked classes are used to establish thread synchronization.

let say a global variable “icounter” is accessed by two threads. both the threads want to increment the value by one after some operation. it is necessary to ensure that both threads do not perform this action at the same time.

interlocked.increment(icounter) will help us to solve this problem.

interlocked class contains some methods like increment, decrement , add , compareexchange etc.
these methods will lock the variable and will perform the necessary operation.

interlocked methods are faster compared to the lock statement

Question 63   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 64   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 65   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 66   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

 Rate this page
 27 votes , average 4 out of 5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 

Reader's opinions -

No comments

.net interview questions interview questions
C# interview questions interview questions 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
IWC's "Little Prince" series has swiss replica watches always been a very rolex replica watches popular watch series. Its highly recognized and very attractive blue dial and the replica rolex watches story of the "Little Prince" have made this watch a highly watchful replica watches companion favorite.