git: 9front

Download patch

ref: 4cabbe15f6cde5fac863ace9468361507b8d945a
parent: c6fe3b0e8ac7d0ed478b1d48659f68cead87a215
author: qwx <qwx@sciops.net>
date: Wed Mar 11 12:41:53 EDT 2026

atomic(2): note that use is discouraged

consider yourselves warned.
atomics are often misunderstood and easily misused.
example: https://preshing.com/20120515/memory-reordering-caught-in-the-act

--- a/sys/man/2/atomic
+++ b/sys/man/2/atomic
@@ -92,3 +92,10 @@
 
 .SH BUGS
 The vlong operations may be emulated in software and therefore must not be called from a note handler.
+.P
+Correct use of atomics is fundamentally hard,
+and they are generally to be avoided.
+If the intent is to use them for anything other than refcounts and id generation,
+look to
+.IR lock (2)
+for alternatives.
--