Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Parallel trigger of different subs

by BrowserUk (Patriarch)
on Jan 02, 2018 at 12:22 UTC ( [id://1206538]=note: print w/replies, xml ) Need Help??


in reply to Parallel trigger of different subs

Simples:

#!perl -slw use strict; use threads; sub one { select('','','',rand(0.01)), print 'one' while 1; } sub two { select('','','',rand(0.01)), print 'two' while 2; } async \&one; two;

Doing something useful with it requires a little more thought.


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". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-19 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found