I would avoid mixing threads and C libraries (in this case, Net::SSH2). Most likely, the C library is not really thread-safe and will only ever work from within one thread.
You don't show how you start up threads and how your threads use the object and the function sftp_file. Maybe only ever using sftp_file from one thread might work, but that's hard to say without seeing the code you're actually using.
In reply to Re: Net::SSH2 issue in thread
by Corion
in thread Net::SSH2 issue in thread
by roperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |