Permalink
Browse files

Remove (+=) and friends cas operators

  • Loading branch information...
1 parent d0fb631 commit 73f60f728c337e08bc3d506888e7d217efecfb60 @lizmat lizmat committed Nov 19, 2013
Showing with 0 additions and 8 deletions.
  1. +0 −8 S17-concurrency.pod
View
8 S17-concurrency.pod
@@ -857,14 +857,6 @@ or more generally for all assignment meta-operators:
cas $a, { $_ * 5 }; # $a *= 5
-This very often occurring construct in concurrent programs, could need some
-syntactic sugar. For assignment meta-operators, this is achieved by putting
-parenthesis around the operator:
-
- $string (~=) "bar"; # cas $string, { $_ ~ "bar" }
-
- $count (+=) 1; # cas $count, { $_ + 1 }
-
However, in concurrent programming, you want to make sure that B<all> updates
to a variable being accessed from multiple concurrent tasks, are wrapped in a
C<cas>. To mark accesses to a variable thusly, you can use the C<is cas>

0 comments on commit 73f60f7

Please sign in to comment.