I am attempting to implement Thread::Needs in a threaded app I have written, and I am
experiencing the following error, even when I try the sample code provided with the
docs:
thread failed to start: Can only call "" in the originating thread at (eval 120) line
7.
thread failed to start: Can only call "" in the originating thread at (eval 120) line
7.
and so on, one error per worker thread I attempt to start with Thread::Pool. I have
found the error message in Pool.pm but I haven't been able to figure out why it is
happening. Is anyone familiar with this? Thanks in advance (the code and info
follows).
Mike Culbertson
This is perl, v5.8.0 built for i386-linux-thread-multi
Running on Debian testing, kernel 2.4.18 (both stock)
the code snip is almost identical to that in the docs (I just added the shebang line)
<CODE>
#!/usr/bin/perl
use Thread::Pool;
use Thread::Needs qw(Thread::Pool Thread::Conveyor);
my $pool = Thread::Pool->new(
{
do => sub { warn "Hello $_[0]!\n" },
workers => 10,
}
);
$pool->job( 'Liz' );
<>; # Look at "top" when "Hello Liz" is shown
$pool->job( 'Wendy' );
</CODE>