[Top][All Lists]

[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 19:45:05 +0100

On Thu, 30 Jun 2016 12:14:00 -0600
Robert Smiley <address@hidden> wrote:
> As for the library busy waiting, yes I suppose it does. The procedures
> reader-ready? and writer-ready? use file-select with a timeout of 0
> from the posix unit under the hood. thread-wait-for-i/o! or
> file-select could be used instead of these procedures to allow a
> thread or the entire process to not busy wait.

You can't use file-select for this purpose, because it also will jam
all "threads".  Having a timeout of 0 will avoid that but at the
expense of a busy wait.  You can mitigate that by including
thread-yield! in the busy loop, but the real answer is to use
thread-wait-for-i/o!.  That does what you want.


reply via email to

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