[mapserver-users] thread safety and php and fastcgi

Frank Warmerdam warmerdam at pobox.com
Thu Sep 2 10:03:11 EDT 2010


William Kyngesburye wrote:
> Bringing back this question from a different angle...
> 
> So, we know that PHP MapScript has some thread safety issues when used with
> PHP as a DSO module.  In my limited understanding of how it works, a DSO
> module is loaded into memory when Apache starts, ready to accept multiple
> different requests, and this permanent state is where the thread safety
> issues come from.
> 
> So, what about mapserv fastcgi?  Isn't this also loaded once, and processes
> multiple requests?
> 
> What about PHP as a fastcgi?  If it's the mapserver-PHP code that has the
> thread safety problem, would PHP as a fastcgi have similar problems as
> PHP-DSO?

William,

In the case of FastCGI the fastcgi mapserver process is only given one
cgi request at a time to handle.  It won't be given another until the
previous one is complete.  Apache can start multiple separate FastCGI
MapServer instances in order to handle multiple requests at once but
they each have their own process.  So, FastCGI does not have
multi-threading issues.  It does occationally run into issues with
memory leaks or "left over state" from a previous cgi request.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-users mailing list