[Top][All Lists]

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

Re: [Chicken-users] TCP and threads again

From: felix winkelmann
Subject: Re: [Chicken-users] TCP and threads again
Date: Thu, 4 Sep 2008 07:41:52 +0200

On Thu, Sep 4, 2008 at 6:00 AM, Shawn Rutledge
<address@hidden> wrote:
> Experience confirms the unit TCP documentation which says that those
> TCP socket operations do not block SRFI-18 threads, but what about
> socket operations that occur via C code?  It would seem that they do
> block threads.  I just ran into this when I tried to use my gps egg
> (under development), which uses libgps to connect to gpsd, in an
> application that has a UI.  After the SRFI-18 thread which polls for
> GPS messages gets started, the UI event loop never even gets a chance
> to start.  Makes me think the Chicken socket implementation must be
> doing something special, not to block the threads.  Am I going to run
> into the same thing with dbus?  I could use gypsy rather than gpsd
> (because it has a dbus interface), but dbus comms are also done with
> sockets.

C-level operations that block will block all threads.  All Scheme-level
thread operations are multiplexed in the scheduler into a big
select(3) loop. By supplying a file-descriptor (as you mention in your
followup mail) you can take advantage of this.


reply via email to

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