Skip to content

Commit c71f130

Browse files
committed
"is cas" is no more
1 parent e7c777d commit c71f130

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

S17-concurrency.pod

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Synopsis 17: Concurrency
1313

1414
Created: 3 Nov 2013
1515

16-
Last Modified: 4 Apr 2014
17-
Version: 15
16+
Last Modified: 16 Apr 2014
17+
Version: 16
1818

1919
This synopsis is based around the concurrency primitives and tools currently
2020
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:
851851

852852
cas $a, { $_ * 5 }; # $a *= 5
853853

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-
863854
Another example, implementing a top-5 news headlines list to be accessed and
864855
updated without ever locking, as:
865856

0 commit comments

Comments
 (0)