Threads of one process share an address space, so the kernel doesn't have to switch page tables
Threads of one process share an address space, so the kernel doesn't have to switch page tables. Page tables map the memory addresses a program uses to real memory.
Both kinds of switch save and restore the registers and the stack pointer. A process switch also changes the address space. This means the kernel loads different page tables. It usually also loses the cached address translations, so the next memory accesses are slower.
"Threads are scheduled by the application, so the kernel is not involved" is wrong. Linux threads are scheduled by the kernel, so the kernel is involved in both cases. "Threads have no registers of their own, so there is nothing to save" is also wrong. Each thread has its own registers.
Read more
- Context switch (https://en.wikipedia.org/wiki/Context_switch)en.wikipedia.org