Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Running 2 different subs simultaneously

by Anonymous Monk
on Jan 02, 2018 at 17:59 UTC ( #1206549=note: print w/replies, xml ) Need Help??


in reply to Parallel trigger of different subs

Sorry, i posted this thread earlier with the Title " Parallel trigger of different sub". I was not specific there. Let me be more specific in this thread. My customer wants to run 2 different subs together.

just for example. Sub A does "clear bgp" and Sub B does "clear ospf " and he don't want to add all the steps in Sub B to Sub A (and run only Sub A). Both should be different entities . But, he wants to execute both "clear bgp" and "clear ospf" at the same time (not one after the other, should be parallel). This is just an example

  • Comment on Running 2 different subs simultaneously

Replies are listed 'Best First'.
Re: Running 2 different subs simultaneously
by karlgoethebier (Monsignor) on Jan 02, 2018 at 20:34 UTC
    "...not one after the other, should be parallel..."

    Try to add say MCE::Hobo->pid(); to the subs and say $$; say for MCE::Hobo->list_running(); say MCE::Hobo->pending(); to main in the example i provided and watch the flow. Also increase the constant AMOUNT and watch what happens in what ever "task manager" you use. You may also say # use threads; and see what happens.

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1206549]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2018-06-19 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (114 votes). Check out past polls.

    Notices?