[FASTCGI] multiple connections to a fastcgi server

Dean Banks connexity2 at gmail.com
Wed May 4 22:25:26 EDT 2011


Hi Marc,

I have a multithreaded fastcgi app that handles multiple requests as 
expected.  I modeled it after the threaded.c example in the SDK as well, 
though I changed to make the FCGX_Accept_r() call non-blocking  (mostly 
so that I could gracefully exit the whole app with SIGINT).

In your application, FCGX_Accept_r() blocks until an incoming request is 
passed from the webserver to your application.  Provided that you have a 
separate context for each thread (as the example shows), you should be 
multithreading properly.  One way to test this might be to use two 
threads, but only sleep if the thread number is 0.  If you open two 
browsers, you should be able to make a request to the first (held up by 
sleep()) and still get active responses from the second broswer (the 
available thread).

Please feel free to post any other questions.  This list is sleepy, but 
has lots of helpful folks lurking.

Cheers,

Dean


More information about the FastCGI-developers mailing list