chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Asynchronous I/O Egg Release


From: Chris Vine
Subject: Re: [Chicken-users] Asynchronous I/O Egg Release
Date: Thu, 30 Jun 2016 14:10:41 +0100

On Thu, 30 Jun 2016 08:42:06 +0200
Peter Bex <address@hidden> wrote:
> On Wed, Jun 29, 2016 at 07:26:48PM -0600, Robert Smiley wrote:
> > Hopefully this library will make it easier to read from and write
> > to any file descriptor without leaving applications hanging, since
> > all srfi-18 threads block when i/o is performed on ports other than
> > tcp sockets.  
> 
> Hello Robert,
> 
> Can you elaborate on that?  CHICKEN marks all file descriptors it
> opens as nonblocking, and most eggs attempt to do so too, if
> possible.  The core system comes with a thread scheduler which
> automatically puts threads to sleep when they're reading from or
> writing to an fd that isn't ready.  So, the system is supposed to do
> automatically what you're exposing here manually.  If it doesn't,
> that would be considered a bug.

Then consider it a bug.  Only sockets from the tcp unit operate in that
way, up to chicken-4.10 at least.  For other descriptors you have to use
chicken's srfi-18 extension, namely thread-wait-for-i/o!.

Having said that, this egg (so far as I could understand it because
there were some missing reader-token procedures) seems to involve
looping on non-blocking descriptors in a busy wait for a read request
to be fulfilled, which doesn't seem the best idea.  But maybe I didn't
spot the code which yields on EAGAIN.

Chris



reply via email to

[Prev in Thread] Current Thread [Next in Thread]