Re: multiple connections to a fastcgi server

Dean Banks <[email protected]> Wed, 04 May 2011 19:25:26 -0700
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
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