File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ Synopsis 17: Concurrency
13
13
14
14
Created: 3 Nov 2013
15
15
16
- Last Modified: 4 Apr 2014
17
- Version: 15
16
+ Last Modified: 16 Apr 2014
17
+ Version: 16
18
18
19
19
This synopsis is based around the concurrency primitives and tools currently
20
20
being implemented in Rakudo on MoarVM and the JVM. It covers both things
@@ -851,15 +851,6 @@ or more generally for all assignment meta-operators:
851
851
852
852
cas $a, { $_ * 5 }; # $a *= 5
853
853
854
- However, in concurrent programming, you want to make sure that B<all> updates
855
- to a variable being accessed from multiple concurrent tasks, are wrapped in a
856
- C<cas>. To mark accesses to a variable thusly, you can use the C<is cas>
857
- trait.
858
-
859
- my $count is cas; # $a++, $a ~= "foo", $a += 5, etc.
860
- my @done is cas; # @done.push, @done.pop, etc.
861
- my %objects is cas; # %objects{.WHAT}.push($_), etc.
862
-
863
854
Another example, implementing a top-5 news headlines list to be accessed and
864
855
updated without ever locking, as:
865
856
You can’t perform that action at this time.
0 commit comments