3 ms·
I made a similar doors api implementation for Linux in 2001 (https://ldoor.sourceforge.net/ https://ldoor.sourceforge.net/). It eliminated the cost of having a
by oecumena 4y ago
I made a similar doors api implementation for Linux in 2001 (https://ldoor.sourceforge.net/ https://ldoor.sourceforge.net/). It eliminated the cost of having a thread pool and context switches by re-using client thread and replacing its MM context with the server context, so that the thread magically finds itself within another process.
- lukeh 4y agoRight, I thought that was the whole idea, like a shuttle?
- cryptonector 4y agoIt is.
- oecumena 4y agoOriginal Solaris doors use server thread pools: https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/fs/doorfs/door_sys.c#L705 https://github.com/illumos/illumos-gate/blob/master/usr/src/...
- cryptonector 4y agoYes, but because when a server thread is available the context switch is immediate and with priority transfer, the effect is similar.
- oecumena 4y agoI agree that the direct hand-off that Solaris shuttles provide is more efficient than general wakeup, but it is less efficient than switching MM context of the client thread. The latter results in twice fewer threads, twice fewer scheduler lock acquisitions, etc. Note that for the kernel-level door servers, Solaris does not use server threads, it directly calls the server entry point function.