chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] All threads are blocking by I/O


From: Peter Bex
Subject: Re: [Chicken-users] All threads are blocking by I/O
Date: Wed, 25 Sep 2013 13:48:29 +0200
User-agent: Mutt/1.4.2.3i

On Wed, Sep 25, 2013 at 07:40:39AM -0400, Pedro Melendez wrote:
> After some experimentation I came out to the realization that the reading
> thread is blocking all other threads. And I actually just found that stated
> on the TCP Unit documentation:
> 
>    - 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.
>
> So, I guess my question is if there is a way to workaround this or I have
> to combine my code with some C++ code to achieve what I want to do?

Hi Pedro!

By default, the tcp unit's procedures will create nonblocking I/O ports, and
the srfi-18 scheduler will multiplex threads over all open sockets using
POSIX poll().  In other words, it should Just Work if you read in one thread
and write in the other thread.

Maybe I'm misunderstanding what you're trying to do?  If so, could you
please send us some sample code to avoid further confusion?

Cheers,
Peter
-- 
http://www.more-magic.net



reply via email to

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