what is difference between userlevel threads and kernel
level threads ?what are the trades offs between these two
approaches ? what approach is most frequently used and why ?

Answer Posted / sneha

*A user thread is normally created by a threading library and scheduling is managed by the threading library itself (Which runs in user mode). All user threads belong to process that created them. The advantage of user threads is that they are portable.
*A kernel thread, sometimes called a LWP (Lightweight Process) is created and scheduled by the kernel. Kernel threads are often more expensive to create than user threads and the system calls to directly create kernel threads are very platform specific.
*The major difference can be seen when using multiprocessor systems, user threads completely managed by the threading library can't be ran in parallel on the different CPUs, although this means they will run fine on uniprocessor systems. Since kernel threads use the kernel scheduler, different kernel threads can run on different CPUs.
Many systems implement threading differently,
*A many-to-one threading model maps many user processes directly to one kernel thread, the kernel thread can be thought of as the main process.
*A one-to-one threading model maps each user thread directly to one kernel thread, this model allows parallel processing on the multiprocessor systems. Each kernel thread can be thought of as a VP (Virtual Process) which is managed by the scheduler.

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is function prototype in c with example?

570


Explain what is the benefit of using #define to declare a constant?

604


What is storage class?

654


What is a keyword?

740


How to write a code for reverse of string without using string functions?

1575






What is the difference between class and object in c?

579


write an algorithm to display a square matrix.

2218


What is difference between constant pointer and constant variable?

626


explain what is a newline escape sequence?

683


Stimulate calculator using Switch-case-default statement for two numbers

2444


What are types of structure?

600


What is #define in c?

615


What do you understand by normalization of pointers?

621


Explain what is the heap?

618


What is #line?

607