what is the difference between user level threads and kernel level threads?
answer 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. 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. 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.