Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created February 19, 2014 23:25
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 jnthn/f292fdc0eafedbe054ae to your computer and use it in GitHub Desktop.
Save jnthn/f292fdc0eafedbe054ae to your computer and use it in GitHub Desktop.
> my $answer = 0; my $t = Thread.start({ $answer = (1..Inf).grep(*.is-prime)[5000] })
Thread.new(app_lifetime => Bool::False, name => "<anon>")
> say "ooh, in main thread :-)"
ooh, in main thread :-)
> $t.finish
Thread.new(app_lifetime => Bool::False, name => "<anon>")
> say $answer
48619
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment