On Sun, Feb 04, 2007 at 03:12:32PM -0500, Bill Davidsen wrote:
Arjan van de Ven wrote:
How does that work? Switching between kernel threads requires going into the kernel, user level thread switches are all done in user mode.Because user threading can avoid context switches, there will always be cases where it will outperform o/s threads for hardware reasons.actually.. switching from one "real" thread to another in Linux is not
an actual context switch in the hardware sense... at least this part of
your argument seems to be incorrect ;)
Do you have some way to change o/s threads w/o going into the kernel?
But going into kernel is not very expensive on Linux.
On the other side, the overhead you need to add for every single syscall
that might block for the M:N threads and the associated complications
which make it far harder to conform to POSIX IMHO far outweight the costs
of going into the kernel for a context switch.