Multithreaded solution using multiple kernel threads?

Asked By 20 points N/A Posted on -
qa-featured

 

In Linux, which of the following will provide a better solution and why?

Multithreaded solution using multiple kernel threads or single threaded solution on a single processor system.

SHARE
Answered By 20 points N/A #152074

Multithreaded solution using multiple kernel threads?

qa-featured

Hi Barb, the one to one models allows for greater concurrency,  but the developer must be careful not to create many threads. The many- to–many models suffer  neither  from this shortcoming.  The developer can create as many user threads as necessary and the corresponding kernel can run in parallel on a  multiprocessors. 

It depends on your need, what is the best for you.  If you choose multi thread solution, it allows a single program to divide it's works in between several processors, this will run faster than a single threaded program which run on only one processor at a time.  Multi threading generally occurs by time-division multiplexing(multi-tasking) the processor switch between different thread.

Related Questions