Re: the suitability of microkernels for POSIX
Posted: Sun Oct 02, 2016 4:55 pm
I am at a loss as to why you say this; could you please explain your reasoning, here?Sik wrote:In a pure asynchronous system there's no thread switching, a "thread" is just a function call and has no state on its own to be preserved, so the only context switching becomes the process itself instead. Actually this would be exactly the same thing as the worker threads idea (where a "control thread" issues tasks to whatever thread is idling), just enforced at the system level.
I could more easily see this as a description of some kinds of synchronous processing, on the basis that the message sender must wait until the recipient has accepted the message, but even then it surely isn't applicable in the general case - once the message is received, the sender can then unblock, and their operations can proceed through whatever scheduling the threading system uses. It also depends on the type of IPC, as well - though right now we are talking strictly about message passing, rather than things like semaphores, pipes, or sockets, most of which are computationally equivalent (in the sense that one could be used as a primitive to implement the others, at least for the purposes of mutual exclusion) but have significant differences in their use cases and dynamic behavior.
Are you certain that you aren't thinking of purely cooperative scheduling? Again, this isn't accurate even then, but it certainly is closer to it (as threads need to cede the processor to the scheduler for any other threads to run on that CPU). However, it ignores both implicit blocking (as with waiting on most I/O operations) and the possibility of multiprocessor scheduling of threads (a significant issue given that the majority of systems now in use have two or more mostly-independent cores). While most userland thread systems do not float threads (that is, allow them to run on a different CPU from the parent process), many kernel thread systems do, and some userland thread schedulers can request for a thread to be floated by the system scheduler if there is a free CPU which shares memory with the one it is on now.