.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions

How do you implement thread synchronization (Object.Wait, Notify,and CriticalSection) in C#?

Posted By :nishithraj     Posted Date :November 30, 2009    Points :10   Category :C# 
You want the lock statement, which is the same as Monitor Enter/Exit:

You can also find related Interview Question to How do you implement thread synchronization (Object.Wait, Notify,and CriticalSection) in C#?  below: 

If you are using C language to implement the heterogeneous linked list, what pointer type will you use?

  
The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type. (More...)

Minimum number of queues needed to implement the priority queue?

  
Two. One queue is used for actual storing of data and another for storing priorities. (More...)

What is a Null object?

  
It is an object of some class whose purpose is to indicate that a real object of that class does not exist. One common use for a null object is a return value from a member function that is supposed to return an object with some specified properties but cannot find such an object. (More...)

What is Object Oriented model?

  
This model is based on collection of objects. An object contains values stored in instance variables with in the object. An object also contains bodies of code that operate on the object. These bodies of code are called methods. Objects that contain same types of values and the same methods are grouped together into classes. (More...)

What is a Thread ?

  
A thread is the basic unit to which the operating system allocates processor time. (More...)

How can you reference current thread of the method ?

  
"Thread.CurrentThread" refers to the current thread running in the method."CurrentThread" is a public static property. (More...)

What's Thread.Sleep() in threading ?

  
Thread's execution can be caused by calling the Thread.Sleep method. This method takes an integer value that determines how long the thread should sleep. Example Thread.CurrentThread.Sleep(2000). (More...)

How can we make a thread sleep for infinite period?

  
You can also place a thread into the sleep state for an indeterminate amount of time by calling Thread.Sleep (System.Threading.Timeout.Infinite). To interrupt this sleep you can call the Thread.Interrupt method. (More...)

What the way to stop a long running thread ?

  
Thread.Abort() stops the thread execution at that moment itself. (More...)

What is Thread.Join() in threading ?

  
There are two versions of Thread.Join :-
. Thread.join().
. Thread.join(Integer) this returns a Boolean value.
The Thread.Join method is useful for determining if a thread has completed before starting another task. The Join method waits a specified amount of time for a thread to end. If the thread ends before the time-out, Join returns true; otherwise it returns False. Once you call Join, the calling procedure stops and waits for the thread to signal that it is done.
Example you have "Thread1" and "Thread2" and while executing 'Thread1" you call "Thread2.Join()".So "Thread1" will wait until "Thread2" has completed its execution and the again invoke "Thread1".
Thread.Join(Integer) ensures that threads do not wait for a long time. If it exceeds a specific time which is provided in integer the waiting thread will start. (More...)

How can I look up a parent class method or property of any System-level object?

  
Use the Class View window, accessed from the standard toolbar by clicking View | Class View. (More...)

What is object Reference Tracing?

  
Object Reference Tracing is record sequential stack traces each time whenever object reference counter is incremented or decremented. These traces help to detect object reference errors, double-dereferencing, failure to reference. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend