FastCGI and threading

Just starting out? Need help? Post your questions and find answers here.
sc4pb
User
User
Posts: 32
Joined: Tue Mar 07, 2023 5:33 pm

FastCGI and threading

Post 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
User avatar
idle
Always Here
Always Here
Posts: 5888
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: FastCGI and threading

Post 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
sc4pb
User
User
Posts: 32
Joined: Tue Mar 07, 2023 5:33 pm

Re: FastCGI and threading

Post 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...
User avatar
idle
Always Here
Always Here
Posts: 5888
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: FastCGI and threading

Post by idle »

look at writeCGIHeader #PB_CGI_HeaderStatus
Post Reply