3 open OUT, ">threaded.fpl";
4 print OUT "#!$Config{perlpath}\n";
5 print OUT while <DATA>;
7 chmod 0755, "threaded.fpl";
14 use constant THREAD_COUNT => 5;
19 my $in = new IO::Handle;
20 my $out = new IO::Handle;
21 my $err = new IO::Handle;
23 my $request = FCGI::Request($in, $out, $err, \%env);
25 while ($request->Accept() >= 0) {
27 "Content-type: text/html\r\n",
29 "<title>FastCGI Hello! (multi-threaded perl, fcgiapp library)</title>",
30 "<h1>FastCGI Hello! (multi-threaded perl, fcgiapp library)</h1>",
31 "Request counts for ", THREAD_COUNT ," threads ",
32 "running on host <i>$env{SERVER_NAME}</i><P><CODE>";
39 for(my $i = 0; $i < THREAD_COUNT; ++$i) {
40 print $out $count[$i];
49 for ($t = 1; $t < THREAD_COUNT; ++$t) {
50 new Thread \&doit, $t;