Unix Interrupts & Keykos Domains
This is some history.
A Linux Threads goldmine.
Generalities on Threads
There are two kinds of threads about and I don’t know how consistent the nomenclature is at making the distinction.
I will call the two kernel threads and user threads here until I get convincing information.
These distinctions make sense only in a Unix context.
- Kernel Threads
- A kernel thread is mainly a construct of the kernel.
- Two processors running in the same “process” require kernel threads.
- Thread switching can take place between arbitrary instructions,
indeed two threads may run simultaneously in one user address space (process) if there are multple processors.
- User Threads
- User code arranges for switching and the kernel is unaware of what thread is running
- The kernel is uninvolved except for
- providing for non-blocking calls to kernel functions that require some asynchronous physical facility beyond the CPU.
Disk and network IO and two important examples.
- providing interrupts (signals) to the process so that the calculation awaiting the completion of the asynchronous service can proceed.
- Thread switching is done explicitly by user mode code.
Note that for one “process” to deploy two processors kernel threads are required.
User threads can only deploy one processor and perhaps several channels and networked transactions.
Xavier Leroy describes clearly a 1997 version of Linux kernel threads.
This description uses “process” and “address space” as the Keykos literature does.
More commonly Unix literature uses “process” to mean address space.
Some information is also available there about Posix threads.
Keykos seems awkward at duplicating the Unix style of thread.
Terminology notes
LWP (Light Weight Process) probably always means kernel thread.