Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created September 3, 2012 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadzik/3610283 to your computer and use it in GitHub Desktop.
Save tadzik/3610283 to your computer and use it in GitHub Desktop.
┌─[tadzik@yavin4]─[~]
└─[%]─> cat threads.nqp
say("alive");
my $x := 5;
my $a := sub foo() {
say($x);
say(5);
}
my $b := pir::new__PSP('Task', $a);
pir::schedule__0P($b);
pir::wait__0P($b);
say(7);
┌─[tadzik@yavin4]─[~]
└─[%]─> parrot-nqp threads.nqp
alive
┌─[tadzik@yavin4]─[~]
└─[%]─> echo $?
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment