Winter Semester 2026–27 · VIT-AP · BACSE106 · Operating Systems · Dr. Krithika L.B

Multithreading models visualised

Compare the mapping models and test yourself.

Module 2 Session 2.3 Lesson 2 of 2

Multithreading models visualised

How user threads map onto the kernel threads that the CPU scheduler actually sees.

Many-to-one

N user → 1 kernel. Fast user-level switching; a blocking call blocks all; no multicore parallelism.

One-to-one

1 user → 1 kernel. True parallelism; blocking affects one thread; more kernel overhead. Linux, Windows.

Many-to-many

N user → M kernel (M ≤ N). Flexible and parallel; complex.

Two-level

Many-to-many plus the option to bind a user thread to a kernel thread.

Scenario: one thread calls read() on a slow disk

The only kernel thread blocks in read() → the other user threads cannot run either. The whole process stalls.

Only that thread's kernel thread blocks. The scheduler runs the other threads, even on other cores.

The library notices the block and schedules another user thread on a different kernel thread.

Process vs thread

ProcessThread
Address spaceOwnShared with other threads of the process
Creation costHigh (copy/map address space)Low
Context switchSlower (change memory map, flush TLB)Faster
CommunicationIPC neededShared variables (needs synchronization)
Fault isolationA crash affects one processA crash kills all threads of the process
Quick check

Which model gives no parallelism on a multicore CPU?

Only one kernel thread exists, so only one core can be used.

Which model does Linux use for Pthreads?

Each pthread is a kernel task.

What do threads of the same process NOT share?

Each thread needs its own stack for its own function calls.