> > 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. > > That really wasn't my question, Arjan said that switching real threads > wasn't a context switch in the hardware sense, and I was asking if I > missed something.
a hardware context switch is basically a CR3 change with associated tlb flush. That is the part that is the most expensive of a context switch. Just going into the kernel and getting out with a different EIP/ESP is really cheap, in the order of "a few hundred cycles"; not a heck of a lot more expensive than a simple getpid or other simple system call. > It may be cheap, but it would seem to be a context > switch none-the-less. it includes a privilege level switch, not so much a full context switch... -- if you want to mail me at work (you don't), use arjan (at) linux.intel.com Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/