Elizabeth Mattijsen wrote:
At 14:16 -0500 1/23/04, Gensky Regnus wrote:
I am having problems mixing the Thread::Pool and Event modules. I can
access the a pool created outside of a callback, but can't create a
pool within the callback. You can see it by running the program below
with and without the argument 'out'.
Please help,
Whoa. Event _and_ threads... ;-)
FWIW, with 5.8.3-threaded under valgrind this is the result:
==11978== Invalid read of size 4
==11978== at 0x8066888: S_my_exit_jump (in
/usr/local/bin/perl5.8.3-threaded)
==11978== by 0x80667DF: Perl_my_failure_exit (in
/usr/local/bin/perl5.8.3-threaded)
==11978== by 0x80A78C6: Perl_vcroak (in
/usr/local/bin/perl5.8.3-threaded)
==11978== by 0x80A7A6E: Perl_croak (in
/usr/local/bin/perl5.8.3-threaded)
==11978== Address 0x8 is not stack'd, malloc'd or free'd
Seems to me something is breaking while Perl is croaking...
I would welcome any insights... I don't have any tuits to pursue that
kind of problem with Thread::Pool.
One comment on the code, though. Why don't you start the pool of
threads always?
Because the pools are created/destroyed in reaction to events. The app
I'm writing uses events for triggering and monitoring of jobs to run and
thread pools as an execution pipeline. This allows me to run several
long running jobs concurrently without halting event processing.
I checked whether this might be related to the on-demand loading of
subs of Thread::Pool. Forcing loading of all subroutines at compile
time (by specifying the environment variable LOAD_NOW) gives identical
results, so I think we can rule out that as a problem.
Does the LOAD_NOW variable affect the other Thread::* modules that
collaborate with Thread::Pool?
Using Event-0.87, Thread::Pool 0.32 and perl 5.8.2/cygwin
-gr