Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created December 6, 2018 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Whateverable/2665d4213a73ea79054d8e6bdb88f6b9 to your computer and use it in GitHub Desktop.
Save Whateverable/2665d4213a73ea79054d8e6bdb88f6b9 to your computer and use it in GitHub Desktop.
evalable6
my $l = Lock.new; my %h; for 1..10 { my $p = start { sleep rand; $l.protect: { say "-- ", $p.WHERE; say %h.elems; %h{$p.WHERE}:delete; say %h.elems } }; say "+", $p.WHERE; %h{$p.WHERE} = $p; }; await %h.values; note %h.elems
+140348910752540
8
+140348910794676
+140348910800252
+140348910805828
+140348910811404
+140348910816980
+140348910822556
+140348910828132
+140348910833708
+140348910839284
-- 140348910752540
10
9
-- 140348910805828
9
8
-- 140348863294312
8
8
-- 140348863290528
8
8
-- 140348863284696
8
8
-- 140348863292440
8
8
-- 140348863281688
8
8
-- 140348863286704
8
8
-- 140348863288616
8
8
-- 140348863280752
8
8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment