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 19:21:19 +0100

On Thu, 30 Jun 2016 19:18:29 +0200
Peter Bex <address@hidden> wrote:
> But AFAIK the manual states that all ports are nonblocking, or am I
> just too confused right now?

All standard R5RS ports are blocking.

What the documentation says is "Blocking I/O will block all threads,
except for some socket operations (see the section about the tcp unit).
An exception is the read-eval-print loop on UNIX platforms: waiting for
input will not block other threads, provided the current input port
reads input from a console."

Socket operations still "block".  However, they yield to another thread
when doing so, and do not become scheduled again until there is
something available to read.

The same effect can be achieved with other ports using
thread-wait-for-i/o!, which although blocking also yields and only
resumes when there is something available to read.  I don't have a
problem with that: you just need to go with it.  And that is what the
original poster's egg should be using.

This is a general manifestation of one of the problems with "green"
threads, and one of the reasons I don't like them: any inadvertent
blocking on system calls jams everything.

Chris



reply via email to

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