chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] busy-wait in tcp-connect


From: felix winkelmann
Subject: Re: [Chicken-users] busy-wait in tcp-connect
Date: Mon, 21 May 2007 06:11:38 +0200

On 5/17/07, Dan Muresan <address@hidden> wrote:
Hi,

I've noticed that calling tcp-connect when a single Chicken thread
exists maxes out the CPU. Try (tcp-connect "1.2.3.4" 80).

In tcp.scm, I see that a thread-block-for-i/o! was commented out:

;; line 543
         (let loop ()
           (let ((f (##net#select-write s)))
             (when (eq? f -1) (fail))
             (unless (eq? f 1)
               ;(##sys#thread-block-for-i/o! ##sys#current-thread s #t)
               (yield)
               (loop) ) ) )

I assume that thread-block-for-i/o somehow failed to wake-up in certain
circumstances, so uncommenting that statement would not be workable?

See also http://www.mail-archive.com/address@hidden/msg03122.html

That message suggests that when connecting to a filtered port (or, in my
case, a non-existent host) not only will the CPU max out, but the call
will never time out. This is not good.


That's right. I can't remember now, why the above code was commented
out, but I'll investigate.


cheers,
felix




reply via email to

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