in reply to Containing threads in object instances

To "take a reference to a method call", you have to use an anonymous subroutine, or else Perl can't tell whether you want to take a reference to the call or to its return value:

my $childThread = threads->new( sub { $self->childThreadWrite }, $l_cqrdMessage);

That may not work, though, as objects can't be shared in 5.8.0 threads.

Replies are listed 'Best First'.
Re: Re: Containing threads in object instances
by tid (Beadle) on Jul 29, 2003 at 01:15 UTC

    Hey, thanks for the quick reply!

    The object sharing might be a problem, but I'll give your solution a try and see how it goes. There's very little I need to do in terms of sharing objects - mainly a single synchronisation flag to make sure the potentially blocking system call has been attempted/completed.

    Thanks again.