Skip to main content
  1. Glossaries/

User-level threads / Kernel-level threads

·1 min
Clément Sauvage
Author
Clément Sauvage
I like to make softwares
  • User-level threads are not recognized by the operating system as they are implemented by the user (e.g in Go, the goroutines are user-level threads that are managed by the runtime). The advantage of these are that they are simple to use and synchronize. We can start as many user-lever threads as we want, but they have a small overhead on start/stop, and they cost additional memory.
  • Kernel-level threads are recognized by the operating system as they are implemented by it. The operating system will offer an interface to create and manage these threads from the user space. We can start as many kernel-level thread as needed, but we can only run as many threads in parallel as core available on the machine. With more threads than core, the operating system’s thread scheduler will have to manage thread switching, which is even more expensive than context switching with user-level threads.