I recognize those as being from IO::Socket. Presumably, IO::Sockets objects can't be shared. Create your connection in the thread where you use it. Your current model doesn't make much sense anyway. Why would you do the slow operation of connecting outside of the thread only to pass the object to the thread?
sub method { my ($self, $deviceInfo, $count) = @_; my $machine = Connector->new($deviceInfo); while ($count) { my ($status, $hostname) = $self->cmd("hostname"); print "$count: $hostname\n"; sleep 1; --$count; } } my $thr1 = threads->create( 'method', $deviceInfo1, 10 ); my $thr2 = threads->create( 'method', $deviceInfo2, 6 );
Net-SSH2 is a threadsafe module, as far as I know.
What gives you that idea? That's a dangerous assumption to make, especially where XS code and external libraries are concerned.
In reply to Re: Attempt to free non-existent shared string 'io_socket_type', Perl interpreter: 0x84972e0 during global destruction.
by ikegami
in thread Attempt to free non-existent shared string 'io_socket_type', Perl interpreter: 0x84972e0 during global destruction.
by madhurikl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |