From cd1070fcbca7f52b0be70f9ed3907001ff8d29c2 Mon Sep 17 00:00:00 2001 From: Ian Date: Sun, 5 Feb 2023 13:32:15 -0500 Subject: [PATCH] add note leading into atomics --- doc/src/manual/multi-threading.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/src/manual/multi-threading.md b/doc/src/manual/multi-threading.md index c09fea4c62cc6b..b341887501fadb 100644 --- a/doc/src/manual/multi-threading.md +++ b/doc/src/manual/multi-threading.md @@ -284,6 +284,9 @@ Note that we do not use buffers based on the `threadid()` i.e. `buffers = zeros( actually change thread at yield points, known as task migration (docs??), which would introduce data races for such a buffering approach. +Another option, which would not make sense for a naive sum like this, is the use of atomic operations on variables shared +across all threads. + ## Atomic Operations Julia supports accessing and modifying values *atomically*, that is, in a thread-safe way to avoid