Skip to content

Commit efec538

Browse files
committed
Fix minor typos and grammar
1 parent 05b6aab commit efec538

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

S17-concurrency.pod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ A Perl 6 implementation of CAS would look something like this:
690690
return $seen;
691691
}
692692

693-
Except that it happens atomically. For example, a crappy non-reenterant
693+
Except that it happens atomically. For example, a crappy non-reentrant
694694
mutex could be implemented as:
695695

696696
class CrappyMutex {
@@ -711,9 +711,9 @@ Another common use of CAS is in providing lock-free data structures. Any data
711711
structure can be made lock-free as long as you're willing to never mutate it,
712712
but build a fresh one each time. To support this, there is another C<&cas>
713713
candidate that takes a scalar and a block. It calls the block with the seen
714-
initial value. The block should return a the new, updated value. If nothing
715-
else updated the value in the meantime, the reference will be updated. In the
716-
case the CAS fails because another update got in first, the block will be run
714+
initial value. The block returns the new, updated value. If nothing
715+
else updated the value in the meantime, the reference will be updated. If
716+
the CAS fails because another update got in first, the block will be run
717717
again, passing in the latest value.
718718

719719
For example, we could implement a top-5 news headlines list, which can be
@@ -742,8 +742,8 @@ of times).
742742
=head1 Locks
743743

744744
Locks are unpleasant to work with, and users are pushed towards higher level
745-
synchronization primitives. However, those need to be implemented in lower
746-
level things for efficiency. As such, a simple lock mechanism - as close to
745+
synchronization primitives. However, those need to be implemented via lower
746+
level constructs for efficiency. As such, a simple lock mechanism - as close to
747747
what the execution environment offers as possible - is provided by the C<Lock>
748748
class. Note that it is erroneous to rely on the exact representation of an
749749
instance of this type (for example, don't assume it can be mixed into). Put
@@ -770,6 +770,6 @@ possible to do:
770770
}
771771

772772
When using the C<lock> and C<unlock> methods, the programmer must ensure that
773-
the lock is unlocked. C<Lock> is reentrant. Naturally, it's possible to easily
773+
the lock is unlocked. C<Lock> is reentrant. Naturally, it's easy to
774774
introduce deadlocks. Again, this is a last resort, intended for those who are
775775
building first resorts.

0 commit comments

Comments
 (0)