in reply to Re^4: Need help with Perl multi threading
in thread Need help with Perl multi threading
So, you mean to say keep the thread that will do all like creating a SSH reference, calling function and what not for each server....?
No. I meant rather than create the Net::SSH::Expect object in the loop and then pass it into the thread, pass the information required to create the session into the thread create the session there.
However, whether that would actually work is predicated upon the module being thread safe and capable of handling concurrent sessions to different servers, which I strongly suspect is not the case, though I do not know for sure and cannot test it.
The bottom line is I do not think that you will be able to use threading and with Net::SSH::Expect. I would suggest that you contact the author and ask him if the module is thread-safe.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Need help with Perl multi threading
by ashok.g (Beadle) on Jan 25, 2012 at 23:01 UTC | |
by BrowserUk (Patriarch) on Jan 26, 2012 at 07:30 UTC | |
by ashok.g (Beadle) on Jan 27, 2012 at 11:57 UTC | |
by BrowserUk (Patriarch) on Jan 27, 2012 at 12:16 UTC |