Multithreading Interview Questions and Answers
9. |
List any four properties of thread class? |
|
- Name - Specify the name for a thread.
- Current Thread – To retrieve the name of currently running thread.
- Is Alive - To retrieve the value to indicate the current state of thread execution. True means thread has been started. False means thread may be terminated
- Is Thread Pool Thread – To retrieve the value to indicate whether a thread is part of a thread pool or not.
|
10. |
What are the features of Sleep method? |
|
- It takes only one argument representing the time.
- It is a static method.
- Invoking Thread.Sleep (0) causes current thread to relinquish.
|
11. |
In what way the mutex class is different from the monitor class? |
|
Differences with monitor class- It is possible to use a same mutex in several processes on a same or even remote machine.
- The use of monitor does not allow waiting on several objects.
- The mutex class does not have Wait() Pulse() and Pulse All() functionalities of the monitor class.
|
12. |
Name the priority values in the thread? |
|
- Normal
- Above Normal
- Below Normal
- Highest
- Lowest
|