Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Is Net::SSH::Expect a thread-safe module?

by Anonymous Monk
on Jan 26, 2012 at 01:29 UTC ( #950005=note: print w/ replies, xml ) Need Help??


in reply to Is Net::SSH::Expect a thread-safe module?

I didn't find this information in the module description even.

This probably means it is not thread-safe

However, Net::SSH::Expect is pure-perl, this probably means it is thread-safe, it depends on the dependencies

Expect is a dependency, so the question, is Expect thread-safe

http://search.cpan.org/dist/Expect/Expect.pod#Is_it_possible_to_use_threads_with_Expect?

Basically yes, with one restriction: you must spawn() your programs in the main thread and then pass the Expect objects to the handling threads.

So yeah, Net::SSH::Expect is probably thread safe

see also ?node_id=3989;HIT=thread%20safe;re=N


Comment on Re: Is Net::SSH::Expect a thread-safe module?
Re^2: Is Net::SSH::Expect a thread-safe module?
by BrowserUk (Pope) on Jan 26, 2012 at 07:20 UTC
    So yeah, Net::SSH::Expect is probably thread safe.

    That is a miserable thing to do to a beginner Anon.

    You might have finished the quote from the Expect POD which goes on to say:

    The reason is that spawn() uses fork(), and perlthrtut:

    "Thinking of mixing fork() and threads? Please lie down and wait until the feeling passes."

    which whilst having more in common with the old map notations, "there be dragon's here", than rational or tested advice, probably does mean that if you venture beyond that point, you will likely be on your own and are going to be breaking new ground.

    Throwing "So yeah" at a (threads) beginner is just mean.


    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?

      That is a miserable thing to do to a beginner Anon.

      You mean a threads beginner like me?

      I can't test it either, which is why I did not speak like I knew for sure.

      The way I read the docs, it probably will work -- its not like it would take long to determine one way or another.

        its not like it would take long to determine one way or another.

        Actually, he has been trying to determine that for a while now and hasn't really reached a conclusion. Hence this latest thread.


        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?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2014-08-30 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls