I am a little confused about how FastCGI works. Does only one instance of my program really work, or is there some kind of magic thread? This is important because if I have data structures that have an area outside the main loop, I need to know if these data structures should be thread safe.
EDIT: My application is in Perl, and here is my apache2 configuration:
<IfModule mod_fastcgi.c> AddHandler fastcgi-script .fcgi .fcg FastCgiServer /usr/lib/app/process.fcg -idle-timeout 60 -processes 1 </IfModule>
Just to understand what I'm asking ... for this code:
use CGI::Fast qw/:standard/; my %sharedHash; while (new CGI::Fast) {
Is the “make stuff” part safe, or is it part of “multithreaded magic," which may mean that more than one thread is doing "doing things" at the same time, thereby corrupting %sharedHash ?
fastcgi
Joelfan
source share