Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Parallel trigger of different subs

by BrowserUk (Pope)
on Jan 02, 2018 at 12:22 UTC ( #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
Node Status?
node history
Node Type: note [id://1206538]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2018-07-20 12:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (431 votes). Check out past polls.

    Notices?