Kernel Threads, Kernel Only Threads, and User Threads

These are the three kinds of threads.

  • Kernel threads
  • Kernel-only threads
  • User threads.

A kernel thread is a kernel entity, like processes and interrupt handlers; it is the entity handled by the system scheduler. A kernel thread runs in user mode environment when executing user functions or library calls; it switches to kernel mode environment when executing system calls.

A kernel-only thread is a kernel thread that executes only in kernel mode environment. Kernel-only threads are controlled by the kernel mode environment programmer through kernel services.

User mode programs can access user threads through a library (such as the libpthreads.a threads library). User threads are part of a portable programming model. User threads are mapped to kernel threads by the threads library, in an implementation dependent manner. The threads library uses a proprietary interface to handle kernel threads. See Understanding Threads in AIX® Version 7.1 General Programming Concepts: Writing and Debugging Programs to get detailed information about the user threads library and their implementation.

All threads discussed in this article are kernel threads; and the information applies only to the kernel mode environment. Kernel threads cannot be accessed from the user mode environment, except through the threads library.