[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: All thread blocked on (accept socket)
From: |
Christopher Cramer |
Subject: |
Re: All thread blocked on (accept socket) |
Date: |
Mon, 4 Mar 2002 17:52:08 -0600 |
User-agent: |
Mutt/1.2.5i |
On Mon, Mar 04, 2002 at 01:26:21PM +0100, Lamy Jean-Baptiste wrote:
> But it looks like, when the first
> thread is waiting on a blocking "(accept socket)", all other threads are
> blocked too and cannot treat their request...
>
> Is that due to the non-native thread used by Guile ? I've tried with
> "(select )" and it works fine...
Hmm. I complained about this a looong time ago, I thought it was fixed,
but I guess not. What you can do is just call select on the socket,
when it's readable, accept won't block:
(define (accept/no-block s)
(let ((fd (list (port->fdes s))))
(if (null? (car (select fd '() '())))
(accept/no-block s)
(accept s))))
I think I'll go fix this... just need to add a call to
scm_internal_select() in scm_accept().
--
Christopher Cramer <address@hidden> <http://www.pyro.net/~crayc/>
Quoi que vous fassiez, écrasez l'infâme, et aimez qui vous aime.
-- Voltaire