in reply to Re: Perl thread issue
in thread Perl thread issue
I have figured out issue since every data element we pass to thread is copied down so queue enqueue and dequeue are not working on same queue due to which second program is not working. But i am not sure how to solve this problem ?
How did you figure that out?
See https://metacpan.org/pod/Thread::Queue#end
Use a different way to signal the end, like
$q->enqueue( [ 'capture' => 'ls -la' ] ); ... $q->enqueue( [ 'exit' ] ); ... while ((my $jackson = $q->dequeue())) my( $action, @args ) = @$jackson; last if $action eq 'exit'; if( $action eq 'capture' ){ my $result ... @args ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl thread issue
by gurjit (Initiate) on Dec 29, 2016 at 00:27 UTC | |
by Anonymous Monk on Dec 29, 2016 at 04:04 UTC |