Thread blocking

Peter Nguyen petern at ...34...
Wed Apr 28 09:17:00 CEST 2010


Hi,

In messing around a bit further with the http server code, I decided to 
have a go at making the HTTP server multithreaded. In this case, I 
wanted the web server to function such that when a HTTP request is 
received, a new thread is created whose purpose is to handle the HTTP 
request. In other words, the http_server_serve() function is made a 
thread, as opposed it being just a function. However, in making the 
changes, the execution seems to result in the web server hanging, with 
the HTTP handler thread not executing at all. This seem to be the case 
because inserting a call to sleep (via the timer connection) in main() 
resulted in the HTTP handler function executing. I would have thought 
that as soon as a HTTP request is received, the main thread would block, 
and from there schedule the HTTP handler thread (I have invoked start() 
on this thread, by the way). At the moment, it seems that the main 
thread blocking seems to result in the entire web server hanging.

Any ideas as to what's going on?

Peter




More information about the users mailing list