[fpc-pascal] How to use FCGI in threaded mode?

Michael Van Canneyt michael at freepascal.org
Fri Jan 30 08:46:58 CET 2015



On Thu, 29 Jan 2015, silvioprog wrote:

> Hello,
> 
> Using the TCustomHTTPApplication class, I just set the "Threaded" property to true, and my application works in threaded mode. But,
> how to do the same in TCustomFCgiApplication class?
>

This is currently not supported.

If you use fastcgi in classical environment, the Apache webserver will start as many instances of 
the fastcgi executable as it considers necessary to handle the load.

Only if you use proxy fastcgi (i.e. a separately running binary listening on a fixed port, 
not started in Apache), then threading may be useful.

To support threading requires a major rework of the fastcgi implementation, 
and probably also changes to fpweb (which is not thread-safe).

This is on my todo list, but you are free to try and supply a patch.

Michael.



More information about the fpc-pascal mailing list