[FASTCGI] libfcgi in multi threaded app
AlannY
m at alanny.ru
Mon May 3 11:27:24 EDT 2010
Hi there.
I'm having trouble with libfcgi and my multi threaded application.
I've created a socket via FCGX_OpenSocket. Everything all right.
Then, I'm creating threads (5, for example). In each thread, I'm
creating a request with FCGX_InitRequest (with socket, created early and
FCGI_FAIL_ACCEPT_ON_INTR).
Then the main loop starts. In this loop I'm calling FCGX_Accept_r on
this request. Here is trouble. Some of threads can successfully accept,
but some of then can't. Return code from FCGX_Accept is -9.
I've tried to setup mutex before and after FCGX_Accept_r, but it's not
helps ;-(
At the end of thread, I'm calling FCGX_Finish_r with 0 (don't destroy
socket, because it may be used by another thread).
What can I do? How to sync threads?
P.S. Single threaded apps works well ;-(
--
)\._.,--....,'``.
/, _.. \ _\ (`._ ,.
`._.-(,_..'--(,_..'`-.;.'
More information about the FastCGI-developers
mailing list