Skip to main content

Process vs thread; user and kernel threads

Short answer

A process is a program in execution with its own address space; a thread is a lightweight unit within a process sharing resources. User-level threads are fast and kernel-agnostic but cannot exploit multiple CPUs; kernel-level threads allow true parallelism and handle blocking better but have higher overhead.

What do you mean by process and thread? Discuss the advantages of user level thread and kernel level thread.

Process and thread

A process is a program in execution, with its own address space, resources and process control block. A thread is a lightweight unit of execution within a process; it has its own program counter, registers and stack but shares code, data and files with other threads of the same process.

BasisProcessThread
WeightHeavyLight
Address spaceSeparateShared
Creation/switch costHighLow
CommunicationVia IPCVia shared memory
ProtectionIsolatedNot isolated

User-level threads (ULT)

Threads are created and managed by a user-space library; the kernel knows only the process.

Advantages:

  • Fast creation and switching: no kernel trap, only a library call.
  • Can run on an OS that does not support threads.
  • Each process can use its own scheduling algorithm.
  • Scale well to a very large number of threads (no kernel table space).

Disadvantage: a blocking system call by one thread blocks the whole process, and threads cannot run on several CPUs at once.

Kernel-level threads (KLT)

Threads are managed by the kernel, which keeps a thread table.

Advantages:

  • The kernel can schedule threads of one process on different CPUs at once (true parallelism).
  • If one thread blocks, the kernel can run another thread of the same process.
  • The kernel can give more CPU time to processes with many threads and can handle thread-level scheduling and signals.

Disadvantage: slower to create and switch (system calls and mode switches), and uses kernel memory.

Hybrid (many-to-many) models, as in Solaris, combine both.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 2 questions →