Skip to content

Commit 3f108cb

Browse files
Update shared-mutable-state-and-concurrency.md (#2309)
1 parent 1b34e1c commit 3f108cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/shared-mutable-state-and-concurrency.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ but others are unique.
2424

2525
### The problem
2626

27-
Let us launch a hundred coroutines all doing the same action thousand times.
27+
Let us launch a hundred coroutines all doing the same action a thousand times.
2828
We'll also measure their completion time for further comparisons:
2929

3030
<div class="sample" markdown="1" theme="idea" data-highlight-only>
@@ -102,7 +102,7 @@ increment the `counter` concurrently from multiple threads without any synchroni
102102

103103
### Volatiles are of no help
104104

105-
There is common misconception that making a variable `volatile` solves concurrency problem. Let us try it:
105+
There is a common misconception that making a variable `volatile` solves concurrency problem. Let us try it:
106106

107107
<!--- CLEAR -->
108108

@@ -158,7 +158,7 @@ do not provide atomicity of larger actions (increment in our case).
158158
### Thread-safe data structures
159159

160160
The general solution that works both for threads and for coroutines is to use a thread-safe (aka synchronized,
161-
linearizable, or atomic) data structure that provides all the necessarily synchronization for the corresponding
161+
linearizable, or atomic) data structure that provides all the necessary synchronization for the corresponding
162162
operations that needs to be performed on a shared state.
163163
In the case of a simple counter we can use `AtomicInteger` class which has atomic `incrementAndGet` operations:
164164

0 commit comments

Comments
 (0)