walkinsindia.com
 
 
 
 
 
No Registration! No Resume Posting!!
 
Receive FREE Email Alerts on Current Walk-in Interviews in India, and Apply Directly to The Employer of Your Choice! - Enter your Email ID and Subscribe Right Now!

                  

 
     
 
DotNet Threading
What are wait handles?
Wait handles sends signals of a thread status from one thread to other thread. There are three kind of wait modes:

WaitOne.
WaitAny.
WaitAll.

When a thread wants to release a Wait handle it can call Set method. You can use Mutex (mutually exclusive) objects to avail for the following modes. Mutex objects are synchronization objects that can only be owned by a single thread at a time. Threads request ownership of the mutex object when they require exclusive access to a resource. Because only one thread can own a mutex object at any time, other threads must wait for ownership of a mutex object before using the resource.

The WaitOne method causes a calling thread to wait for ownership of a mutex object. If a thread terminates normally while owning a mutex object, the state of the mutex object is set to be signaled and the next waiting thread gets ownership.
What is manualResetEvent and AutoResetEvent?
Threads that call one of the wait methods of a synchronization event must wait until another thread signals the event by calling the Set method. There are two synchronization event classes. Threads set the status of ManualReset Event instances to signaled using the Set method. Threads set the status of ManualResetEvent instances to no signaled using the Reset method or when control returns to a waiting WaitOne call. Instances of the AutoReset Event class can also be set to signaled using Set, but they automatically return to nonsignaled as soon as a waiting thread is notified that the event became signaled.
What is Readerwriter Locks?
You may want to lock a resource only when data is being written and permit multiple clients to simultaneously read data when data is not being updated. The ReaderWriter Lock class enforces exclusive access to a reource while a thread is modifying the resource, but it allows nonexclusive access when reading the resource. ReaderWriter locks are a useful alternative to exclusive locks that cause other threads to wait, even when those threads do not need to update data.
How can you avoid deadlock in threading?
A good and careful planning can avoid deadlocks. There are so many ways Microsoft has provided by which you can reduce deadlocks example Monitor, Interlocked classes, Wait handles, Event raising from one thread to other thread, ThreadState property which you can poll and act accordingly etc.
What is the difference between thread and process?
A thread is a path of execution that run on CPU, a process is a collection of threads that share the same virtual memory. A process ha at least one thread of execution, and a thread always run in a process context.
Prev



Post Interview Questions


 
     
     
 
Home  |  About Us  |  Post Walk-in for FREE  |  Policies  |  Contact Us  |  Advertise
 
 
Copyright © 2008 WalkinsIndia.com.   All Rights Reserved.