Top 25+ Advanced Multithreading Interview Questions 2020-21 - 1

Question: 1

List out the classes in the system.threading namespace?

The following classes are important in this namespace.

Thread,

Thread Pool,

Monitor,

Mutex.

Question: 2

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.

Question: 3

Explain the process based and thread based multitasking?

Process Based Multitasking

    Multitasking of two or more processes in known as process based multitasking.

    It is totally controlled by the operating system.

Thread based multitasking

    Multitasking of two or more threads is known as thread based multitasking.

    It is controlled by the programmer.

    It has the following advantages over the process based multitasking.

Question: 4

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.

Error Report!

Related Questions