Subject: Re: M:N and blocking ops without SA, AIO
To: Jason Thorpe <thorpej@shagadelic.org>
From: None <jonathan@dsg.stanford.edu>
List: tech-kern
Date: 03/01/2007 11:27:30
In message <E04713A7-205C-45F1-8712-0BD05E29D6EC@shagadelic.org>,
Jason Thorpe writes:

>On Mar 1, 2007, at 10:22 AM, jonathan@dsg.stanford.edu wrote:
>
>> Well, the typical way to implement AIO is to have a pool of kernel
>> threads. Grab a kernel thread, issue the i/o, using the kernel thread
>> as the thread which blocks until the I/O is complete.  Then the kernel
>> thread posts completion to the AIO subsystem, which passes appropriate
>> status, signal info, etc. to the requesting thread.  Hmmmm,  
>> continuations :-/.
>
>...and that's an awful way to do it considering how all of the  
>underlying primitives that those blocking APIs use are asynchronous.

Yes, exactly.  (I did say "typical", I was trying to be polite.)

If you recall that back when I committed kcont(9), I beleive I
suggested asynchronous I/O as one obvious use for kcont.  I seem to
recall some objections that continuations were too difficult to
understand; but maybe I'm misremembering.