Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Need help with Perl multi threading

by BrowserUk (Pope)
on Jan 25, 2012 at 22:20 UTC ( #949985=note: print w/ replies, xml ) Need Help??


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.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?


Comment on Re^5: Need help with Perl multi threading
Re^6: Need help with Perl multi threading
by ashok.g (Beadle) on Jan 25, 2012 at 23:01 UTC
    I tried even that but still getting the segmentation fault.... all these trial are not working with Net::SSH::Expect and threads..... :-|
      . all these trial are not working with Net::SSH::Expect and threads.....

      That is what I suspected. I don't use a platform where Expect runs; nor do I have a handy list of machines I could SSH into, so there is nothing I can do to help you with this. Sorry.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

        No worries. I am able to achieve my functionality by using Net::OpenSSH.

        Thank you Perl Monks for your help.

        Thanks,
        Ashok

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://949985]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-12-27 04:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls