>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:

  DS> Might sound that way, but it isn't. What I'm talking about is
  DS> something like:

  DS>     READ S3, P1, I0
  DS> X: SLEEP 3
  DS>     EQ I0, 0, X
  DS>     PRINT S3

  DS> Where we issue the read on the filehandle in P1, telling it to
  DS> store the results in S3, and put the completion status in I0. The
  DS> sleep will presumably be replaced by code that actually does
  DS> something, and we wait as long as the completion register says
  DS> we're not done.

and internally tha READ op will do an aio_read if it is supported on
this platform. the sleep op is like wait in pdp-11 assembler. there you
could wait for interrupts to wake you up. that sleep op needs to do a
blocking operation like poll/select so it can release the cpu for other
threads/processes. it will be woken up by a signal that the file async
i/o is done

a variation is to have a WAIT op which waits for a particular io handle
to be done. it also will do some blocking select/poll call and let
itself be woken up as above. but it will check for its i/o being done
and go back to blocking sleep if it is not completed.

so you can issue an async i/o request anytime and sync up with it (with
WAIT) later when you want the data.

this model was in RT-11 30 years ago and it works well. you can have
async and sync i/o with a simple set of ops, READ, WRITE and WAIT.

we could also have a WAIT with a wild card arg too. it waits for any
completion of i/o and then other parrot code must check for what has
completed and deal with it.

uri

-- 
Uri Guttman  ---------  [EMAIL PROTECTED]  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs  --------------------------  http://jobs.perl.org

Reply via email to