Multithreading Interview Questions and Answers
5. |
Give the methods of thread class? |
|
The following are the methods supported by the tread class.- Start – to start a thread.
- Join – to block a thread until another thread has terminated.
- Resume – to resume the thread.
- Suspend – to suspend a thread.
- Sleep – to block the thread for some time.
-
Spinwait – to make a thread wait for the number of times specified in the Iterations parameters.
- Interrupt – to interrupt the thread which is in the wait Sleep Join state.
|
6. |
Define child thread? |
|
The threads created by the main thread are known as secondary threads or child threads. |
7. |
List out the states in the thread? |
|
The following are the important states in the thread.- Started - New thread is spawn and is running.
- Unstarted - Thread is not yet started.
- WaitJoinSleep – Wait state.
- Suspended - Blocked for an event.
- StopReq - Request to stop.
- Stopped - Execution completed or aborted.
|
8. |
List out the classes in the System.Threading Namespace? |
|
The following classes are important in this namespace.
Thread, Thread Pool, Monitor, Mutex.
|