Introduction A thread is the smallest unit of CPU utilization within a process, comprising its own program counter, register set and stack space, but sharing the process’s code, data and OS resources. Threads enable parallelism and better resource utilization. Based on where threads are managed, they are classified into User-Level Threads (ULTs) and Kernel-Level Threads (KLTs).


1. User-Level Threads (ULT)

  1. Definition & Implementation
  2. Thread Management
  3. Advantages
  4. Disadvantages

2. Kernel-Level Threads (KLT)

  1. Definition & Implementation
  2. Thread Management
  3. Advantages
  4. Disadvantages

3. Comparison

Aspect User-Level Threads Kernel-Level Threads
Management Thread library in user space OS kernel
Creation/Destroy Very fast (function calls) Slower (system calls)
Context Switch Cheap (no mode switch) Expensive (user ↔ kernel mode switch)
Blocking Entire process blocks on one thread’s I/O Only the blocked thread sleeps; others continue
Concurrency No true parallelism on multiprocessors True parallelism on multiple CPUs
Scheduling Library-defined (cooperative or timer-driven) Kernel-defined (preemptive, priorities)
Portability High (library-based) Depends on OS support and versions