File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ so do familiarize yourself with the following guidelines.
4646 Use 4 spaces for indentation.
4747 * [ Build the project] ( #building ) to make sure it all works and passes the tests.
4848* If you fix a bug:
49- * Write the test the reproduces the bug.
49+ * Write the test that reproduces the bug.
5050 * Fixes without tests are accepted only in exceptional circumstances if it can be shown that writing the
5151 corresponding test is too hard or otherwise impractical.
5252 * Follow the style of writing tests that is used in this project:
Original file line number Diff line number Diff 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.
2828We'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
160160The 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
162162operations that needs to be performed on a shared state.
163163In the case of a simple counter we can use ` AtomicInteger ` class which has atomic ` incrementAndGet ` operations:
164164
You can’t perform that action at this time.
0 commit comments