chicken-janitors
[Top][All Lists]
Advanced

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

[Chicken-janitors] [Chicken-bugs] #330: Multithreaded sendfile doesn't w


From: Chicken Scheme
Subject: [Chicken-janitors] [Chicken-bugs] #330: Multithreaded sendfile doesn't work
Date: Fri, 28 Sep 2007 21:58:54 -0000

#330: Multithreaded sendfile doesn't work
--------------------+-------------------------------------------------------
Reporter:  sjamaan  |       Owner:            
    Type:  defect   |      Status:  new       
Priority:  minor    |   Component:  extensions
 Version:  2.7      |    Keywords:  threading 
--------------------+-------------------------------------------------------
 When sendfile is busy transfering a file, it never yields the current
 thread, so no other thread will ever get scheduled.

 The easiest way to see this in action is to pick a huge file and fetch it
 from spiffy, then open a new tab in your browser and access the same
 webserver.  There should be a thread ready, but it can't get scheduled.

 I implemented a fix that appears to work, but I think this is missing some
 important things.  I looked at chicken/trunk/tcp.scm in {{{##net#io-
 ports}}}, under {{{output}}}.  You see there that it sets the status of
 the thread as "blocking for i/o".  I'm not sure how to do this from C.
 Also, I don't understand what the {{{(when (##sys#slot ##sys#current-
 thread 13) ...)}}} is supposed to do.  I guess the thread should also
 block for a timeout, otherwise sendfile will never stop trying to send a
 file over a dropped connection.  Better ask Felix for more details, as
 this is a little over my head!

-- 
Ticket URL: <http://trac.callcc.org/ticket/330>
Chicken Scheme <http://www.call-with-current-continuation.org/>
The CHICKEN Scheme-to-C compiler

reply via email to

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