On Wed, 3 Aug 2005, Plymouth Rock wrote:

I'd using ithreads on ActivePerl 5.8.7 and Apache/2.0.54 (Win32). All scripts with ithreads did working excellent. Since I've installed mod_perl/2.0.1 with 'ppm install', those scripts have ceased to work (there's an initial HTML-table's dumping only). Due to I couldn't find another ways to demonstrate several processes working in pseudo-parallel (on win32), I was forced to write CGI- scripts just for a browser, not for shell. That is why I print out a multicolumn table.

What there are on my PC:
w2k SP3
MSIE6 SP1
Apache/2.0.54 (Win32)
mod_ssl/2.0.54
OpenSSL/0.9.7g
PHP/4.3.11
mod_perl/2.0.1
Perl/v5.8.7
[ ... ]
I'm writing and running CGI-scripts under MSIE6 that use the $|++ buffering, the threads module and so on. Here are all the modules I'm using within any single thread-script:

use strict;
use warnings;
use Time::HiRes;
use threads;
use threads::shared;
use Thread::Queue;
[ ... ]
A script was placed to C:/Program Files/Apache Group/Apache2/perl/
dir and running from MSIE as http://localhost/perl/myscript.pl with no
shebang!

Hi,
   The shebang isn't needed for Registry scripts.

Now the error.log says:

Sat Jul 30 16:33:19 2005] [notice] Child 1048: Child process is running
[Sat Jul 30 16:33:19 2005] [notice] Child 1048: Acquired the start mutex.
[Sat Jul 30 16:33:19 2005] [notice] Child 1048: Starting 4 worker threads.
Variable "$q_letters" will not stay shared at (eval 75) line 75.
Variable "@threads" will not stay shared at (eval 75) line 73.
...and so on.

When I'd running that script with Perl.exe interpreter from cgi-bin dir
and #!C:\Perl\bin\perl -w shebang, there weren't any errors and warning
messages.

Here is an example of what is the $q_letters variable:
my $q_letters = new Thread::Queue;
$q_letters->enqueue('a','b','c',   'd','e','f',   'g','h','i');

I'm not an expert on ithreads (Stas is the resident
guru on this), but from messages such as
 
http://marc.theaimsgroup.com/?l=apache-modperl&w=2&r=1&s=threads%3A%3Ashared&q=b
there's still issues with these, especially in a mod_perl
environment.

Could you post a complete (but minimal) script that
illustrates the problem you're encountering? From what
you wrote above, I tried this Registry script:
=======================================================
#!D:/Perl/bin/perl
##
##  printenv -- demo CGI program which just prints its environment
##
use strict;
use warnings;
use threads;
use threads::shared;
use Thread::Queue;
my $q_letters = new Thread::Queue;
$q_letters->enqueue('a','b','c',   'd','e','f',   'g','h','i');

print <<"END";
Content-type: text/html

<HTML><HEAD>
<TITLE>Hello</TITLE>
</HEAD><BODY>
<H3>Hello</H3>
</BODY></HTML>
END

===========================================================
and didn't see any messages of the sort you saw in the
error log, nor did the Apache process grow (I'm using
the system that I used to make up the all-in-one
binary you're using).

--
best regards,
randy kobes

Reply via email to