9 Oct 2003 14:15
Trouble with handles and threads
Aki Helin <ahelin <at> mail.student.oulu.fi>
2003-10-09 12:15:05 GMT
2003-10-09 12:15:05 GMT
Hi, Below is a small program that is supposed to serve one web page on port 10001. The page is served by a thread spawned when the socket connection is established. The thread uses 'try' to print each content line. Calling try is supposed to always return, and in case of any error #f should be returned. The printing thread prints the page until try returns #f, in which case the thread is terminated. The trouble is that unless try is traced, scheme48vm still keeps using 100% of cpu after the thread is terminated. Trying a few variations of this always resulted in a similar problem. For example cpu load would remain in 100% after terminate-current-thread finished unless the parameters of try were printed. This example is taken from across a few modules that make up a web server and some cgi applications. They have run under scsh for about 6 months now without any trouble. I wonder if this is a bug or a feature. ------8<------- ,open sockets ascii handle threads (define (print . args)(Continue reading)
RSS Feed