Page 1 of 1

FastCGI and threading

Posted: Wed Jul 23, 2025 2:56 am
by sc4pb
I'm messing about with FastCGI without much trouble (thank you PB) I am assuming requests coming in can be handled on multiple threads, but I'm not sure what this somewhat vague statement in the InitFastCGI section of the docs means:
This library support threaded FastCGI processing, when enabling the ’thread-mode’ in
PureBasic.
...does something special need to be enabled? Or is this just implying you should handle the threading yourself... Thanks

Re: FastCGI and threading

Posted: Wed Jul 23, 2025 3:11 am
by idle
The lib is threadsafe if you set the compiler option to threadsafe is what it means.
Compiler -> Compiler Options -> Create thread safe exe

Re: FastCGI and threading

Posted: Thu Jul 31, 2025 8:09 pm
by sc4pb
Thanks, I guessed it meant you simply handle the threading on your own as with any project.

Now another simple question, but for some reason I can't find the answer on forum or docs. How can I change the HTTP status that is returned with the cgi response? I may want to return http 204 or 400 etc...

Re: FastCGI and threading

Posted: Thu Jul 31, 2025 11:09 pm
by idle
look at writeCGIHeader #PB_CGI_HeaderStatus