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 13   What the way to stop a long running thread ?

Thread.abort() is used to stop a long running thread



Question 14   What is thread.join() in threading

Consider two threads t1 and t2 are running parallel. t1 calls t2.join(). at this point t1 will pause its execution and wait for t2 to complete. when t2 completes its execution t1 will resume.

there is one more method thread.join(int)

in this let’s say t1 calls t2.join(100). at this point t1 will pause its execution and wait for t2 to complete. but compared to the previous example t1 will wait only for 100 milliseconds. t1 will resume its execution after 100 milliseconds (even if t2 is executing)




Question 15   What are daemon threads and how can a thread be created as daemon

Threads which are executing in the background are known as daemon threads.
by setting thread.isbackground = true we can make it as a demon thread
a classic example of a daemon thread is garbage collector.



Question 16   How do you implement synchronization in threading

We can achieve synchronization by using the below methods

1) lock and synclock
2) monitors
3) wait handlers
4) mutex object
5) interlocked class
6) readwriterlock class



Question 17   How can we know a state of a thread

Thread.threadstate property gives the information about threads current state



Question 18   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




 Rate this page
     
 21 votes , average 2 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