123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612 |
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <!-- This file is generated by Nim. -->
- <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>std/atomics</title>
- <!-- Google fonts -->
- <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
- <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
- <!-- Favicon -->
- <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
- <link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
- <!-- CSS -->
- <link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
- <!-- JS -->
- <script type="text/javascript" src="dochack.js?v=2.3.1"></script>
- </head>
- <body>
- <div class="document" id="documentId">
- <div class="container">
- <h1 class="title">std/atomics</h1>
- <div class="row">
- <div class="three columns">
- <div class="theme-select-wrapper">
- <label for="theme-select">Theme: </label>
- <select id="theme-select" onchange="setTheme(this.value)">
- <option value="auto">🌗 Match OS</option>
- <option value="dark">🌑 Dark</option>
- <option value="light">🌕 Light</option>
- </select>
- </div>
- <div id="global-links">
- <ul class="simple-boot">
- <li><a href="manual.html">Manual</a></li>
- <li><a href="lib.html">Standard library</a></li>
- <li> <a id="indexLink" href="theindex.html">Index</a></li>
- <li><a href="compiler/theindex.html">Compiler docs</a></li>
- <li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
- <li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
- </ul>
- </div>
- <div id="searchInputDiv">
- Search: <input type="search" id="searchInput"
- oninput="search()" />
- </div>
-
- <ul class="simple simple-toc" id="toc-list">
- <li>
- <details open>
- <summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
- <ul class="simple simple-toc-section">
- <li><a class="reference" href="#Atomic" title="Atomic[T] {.importcpp: "std::atomic", completeStruct.} = object">Atomic</a></li>
- <li><a class="reference" href="#AtomicFlag" title="AtomicFlag {.importcpp: "std::atomic_flag", size: 1.} = object">AtomicFlag</a></li>
- <li><a class="reference" href="#MemoryOrder" title="MemoryOrder {.importcpp: "std::memory_order".} = enum
- moRelaxed, ## No ordering constraints. Only the atomicity and ordering against
- ## other atomic operations is guaranteed.
- moConsume, ## This ordering is currently discouraged as it's semantics are
- ## being revised. Acquire operations should be preferred.
- moAcquire, ## When applied to a load operation, no reads or writes in the
- ## current thread can be reordered before this operation.
- moRelease, ## When applied to a store operation, no reads or writes in the
- ## current thread can be reorderd after this operation.
- moAcquireRelease, ## When applied to a read-modify-write operation, this behaves like
- ## both an acquire and a release operation.
- moSequentiallyConsistent ## Behaves like Acquire when applied to load, like Release when
- ## applied to a store and like AcquireRelease when applied to a
- ## read-modify-write operation.
- ## Also guarantees that all threads observe the same total ordering
- ## with other moSequentiallyConsistent operations.">MemoryOrder</a></li>
- </ul>
- </details>
- </li>
- <li>
- <details open>
- <summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
- <ul class="simple simple-toc-section">
- <ul class="simple nested-toc-section">+=
- <li><a class="reference" href="#%2B%3D%2CAtomic%5BT%3A%20SomeInteger%5D%2CT" title="`+=`[T: SomeInteger](location: var Atomic[T]; value: T)">`+=`[T: SomeInteger](location: var Atomic[T]; value: T)</a></li>
- </ul>
- <ul class="simple nested-toc-section">-=
- <li><a class="reference" href="#-%3D%2CAtomic%5BT%3A%20SomeInteger%5D%2CT" title="`-=`[T: SomeInteger](location: var Atomic[T]; value: T)">`-=`[T: SomeInteger](location: var Atomic[T]; value: T)</a></li>
- </ul>
- <ul class="simple nested-toc-section">atomicDec
- <li><a class="reference" href="#atomicDec%2CAtomic%5BT%3A%20SomeInteger%5D%2CT" title="atomicDec[T: SomeInteger](location: var Atomic[T]; value: T = 1)">atomicDec[T: SomeInteger](location: var Atomic[T]; value: T = 1)</a></li>
- </ul>
- <ul class="simple nested-toc-section">atomicInc
- <li><a class="reference" href="#atomicInc%2CAtomic%5BT%3A%20SomeInteger%5D%2CT" title="atomicInc[T: SomeInteger](location: var Atomic[T]; value: T = 1)">atomicInc[T: SomeInteger](location: var Atomic[T]; value: T = 1)</a></li>
- </ul>
- <ul class="simple nested-toc-section">clear
- <li><a class="reference" href="#clear%2CAtomicFlag%2CMemoryOrder" title="clear(location: var AtomicFlag; order: MemoryOrder = moSequentiallyConsistent)">clear(location: var AtomicFlag; order: MemoryOrder = moSequentiallyConsistent)</a></li>
- </ul>
- <ul class="simple nested-toc-section">compareExchange
- <li><a class="reference" href="#compareExchange%2CAtomic%5BT%5D%2CT%2CT%2CMemoryOrder" title="compareExchange[T](location: var Atomic[T]; expected: var T; desired: T;
- order: MemoryOrder = moSequentiallyConsistent): bool">compareExchange[T](location: var Atomic[T]; expected: var T; desired: T;
- order: MemoryOrder = moSequentiallyConsistent): bool</a></li>
- <li><a class="reference" href="#compareExchange%2CAtomic%5BT%5D%2CT%2CT%2CMemoryOrder%2CMemoryOrder" title="compareExchange[T](location: var Atomic[T]; expected: var T; desired: T;
- success, failure: MemoryOrder): bool">compareExchange[T](location: var Atomic[T]; expected: var T; desired: T;
- success, failure: MemoryOrder): bool</a></li>
- </ul>
- <ul class="simple nested-toc-section">compareExchangeWeak
- <li><a class="reference" href="#compareExchangeWeak%2CAtomic%5BT%5D%2CT%2CT%2CMemoryOrder" title="compareExchangeWeak[T](location: var Atomic[T]; expected: var T; desired: T;
- order: MemoryOrder = moSequentiallyConsistent): bool">compareExchangeWeak[T](location: var Atomic[T]; expected: var T; desired: T;
- order: MemoryOrder = moSequentiallyConsistent): bool</a></li>
- <li><a class="reference" href="#compareExchangeWeak%2CAtomic%5BT%5D%2CT%2CT%2CMemoryOrder%2CMemoryOrder" title="compareExchangeWeak[T](location: var Atomic[T]; expected: var T; desired: T;
- success, failure: MemoryOrder): bool">compareExchangeWeak[T](location: var Atomic[T]; expected: var T; desired: T;
- success, failure: MemoryOrder): bool</a></li>
- </ul>
- <ul class="simple nested-toc-section">exchange
- <li><a class="reference" href="#exchange%2CAtomic%5BT%5D%2CT%2CMemoryOrder" title="exchange[T](location: var Atomic[T]; desired: T;
- order: MemoryOrder = moSequentiallyConsistent): T">exchange[T](location: var Atomic[T]; desired: T;
- order: MemoryOrder = moSequentiallyConsistent): T</a></li>
- </ul>
- <ul class="simple nested-toc-section">fence
- <li><a class="reference" href="#fence%2CMemoryOrder" title="fence(order: MemoryOrder)">fence(order: MemoryOrder)</a></li>
- </ul>
- <ul class="simple nested-toc-section">fetchAdd
- <li><a class="reference" href="#fetchAdd%2CAtomic%5BT%3A%20SomeInteger%5D%2CT%2CMemoryOrder" title="fetchAdd[T: SomeInteger](location: var Atomic[T]; value: T;
- order: MemoryOrder = moSequentiallyConsistent): T">fetchAdd[T: SomeInteger](location: var Atomic[T]; value: T;
- order: MemoryOrder = moSequentiallyConsistent): T</a></li>
- </ul>
- <ul class="simple nested-toc-section">fetchAnd
- <li><a class="reference" href="#fetchAnd%2CAtomic%5BT%3A%20SomeInteger%5D%2CT%2CMemoryOrder" title="fetchAnd[T: SomeInteger](location: var Atomic[T]; value: T;
- order: MemoryOrder = moSequentiallyConsistent): T">fetchAnd[T: SomeInteger](location: var Atomic[T]; value: T;
- order: MemoryOrder = moSequentiallyConsistent): T</a></li>
- </ul>
- <ul class="simple nested-toc-section">fetchOr
- <li><a class="reference" href="#fetchOr%2CAtomic%5BT%3A%20SomeInteger%5D%2CT%2CMemoryOrder" title="fetchOr[T: SomeInteger](location: var Atomic[T]; value: T;
- order: MemoryOrder = moSequentiallyConsistent): T">fetchOr[T: SomeInteger](location: var Atomic[T]; value: T;
- order: MemoryOrder = moSequentiallyConsistent): T</a></li>
- </ul>
- <ul class="simple nested-toc-section">fetchSub
- <li><a class="reference" href="#fetchSub%2CAtomic%5BT%3A%20SomeInteger%5D%2CT%2CMemoryOrder" title="fetchSub[T: SomeInteger](location: var Atomic[T]; value: T;
- order: MemoryOrder = moSequentiallyConsistent): T">fetchSub[T: SomeInteger](location: var Atomic[T]; value: T;
- order: MemoryOrder = moSequentiallyConsistent): T</a></li>
- </ul>
- <ul class="simple nested-toc-section">fetchXor
- <li><a class="reference" href="#fetchXor%2CAtomic%5BT%3A%20SomeInteger%5D%2CT%2CMemoryOrder" title="fetchXor[T: SomeInteger](location: var Atomic[T]; value: T;
- order: MemoryOrder = moSequentiallyConsistent): T">fetchXor[T: SomeInteger](location: var Atomic[T]; value: T;
- order: MemoryOrder = moSequentiallyConsistent): T</a></li>
- </ul>
- <ul class="simple nested-toc-section">load
- <li><a class="reference" href="#load%2CAtomic%5BT%5D%2CMemoryOrder" title="load[T](location: var Atomic[T]; order: MemoryOrder = moSequentiallyConsistent): T">load[T](location: var Atomic[T]; order: MemoryOrder = moSequentiallyConsistent): T</a></li>
- </ul>
- <ul class="simple nested-toc-section">signalFence
- <li><a class="reference" href="#signalFence%2CMemoryOrder" title="signalFence(order: MemoryOrder)">signalFence(order: MemoryOrder)</a></li>
- </ul>
- <ul class="simple nested-toc-section">store
- <li><a class="reference" href="#store%2CAtomic%5BT%5D%2CT%2CMemoryOrder" title="store[T](location: var Atomic[T]; desired: T;
- order: MemoryOrder = moSequentiallyConsistent)">store[T](location: var Atomic[T]; desired: T;
- order: MemoryOrder = moSequentiallyConsistent)</a></li>
- </ul>
- <ul class="simple nested-toc-section">testAndSet
- <li><a class="reference" href="#testAndSet%2CAtomicFlag%2CMemoryOrder" title="testAndSet(location: var AtomicFlag;
- order: MemoryOrder = moSequentiallyConsistent): bool">testAndSet(location: var AtomicFlag;
- order: MemoryOrder = moSequentiallyConsistent): bool</a></li>
- </ul>
- </ul>
- </details>
- </li>
- </ul>
- </div>
- <div class="nine columns" id="content">
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L1" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L1" class="link-seesrc" target="_blank" >Edit</a>
- <div id="tocRoot"></div>
-
- <p class="module-desc"><p>Types and operations for atomic operations and lockless algorithms.</p>
- <p>Unstable API.</p>
- <p>By default, C++ uses C11 atomic primitives. To use C++ <tt class="docutils literal"><span class="pre"><span class="Identifier">std</span><span class="Punctuation">:</span><span class="Punctuation">:</span><span class="Identifier">atomic</span></span></tt>, <tt class="docutils literal"><span class="pre"><span class="Operator">-</span><span class="Identifier">d</span><span class="Punctuation">:</span><span class="Identifier">nimUseCppAtomics</span></span></tt> can be defined.</p>
- <p><strong class="examples_text">Example:</strong></p>
- <pre class="listing"><span class="Keyword">import</span> <span class="Identifier">std</span><span class="Operator">/</span><span class="Identifier">atomics</span>
- <span class="Comment"># Atomic</span>
- <span class="Keyword">var</span> <span class="Identifier">loc</span><span class="Punctuation">:</span> <span class="Identifier">Atomic</span><span class="Punctuation">[</span><span class="Identifier">int</span><span class="Punctuation">]</span>
- <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">store</span><span class="Punctuation">(</span><span class="DecNumber">4</span><span class="Punctuation">)</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">load</span> <span class="Operator">==</span> <span class="DecNumber">4</span>
- <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">store</span><span class="Punctuation">(</span><span class="DecNumber">2</span><span class="Punctuation">)</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">load</span><span class="Punctuation">(</span><span class="Identifier">moRelaxed</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">2</span>
- <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">store</span><span class="Punctuation">(</span><span class="DecNumber">9</span><span class="Punctuation">)</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">load</span><span class="Punctuation">(</span><span class="Identifier">moAcquire</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">9</span>
- <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">store</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">,</span> <span class="Identifier">moRelease</span><span class="Punctuation">)</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">load</span> <span class="Operator">==</span> <span class="DecNumber">0</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">exchange</span><span class="Punctuation">(</span><span class="DecNumber">7</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">0</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">load</span> <span class="Operator">==</span> <span class="DecNumber">7</span>
- <span class="Keyword">var</span> <span class="Identifier">expected</span> <span class="Operator">=</span> <span class="DecNumber">7</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">compareExchange</span><span class="Punctuation">(</span><span class="Identifier">expected</span><span class="Punctuation">,</span> <span class="DecNumber">5</span><span class="Punctuation">,</span> <span class="Identifier">moRelaxed</span><span class="Punctuation">,</span> <span class="Identifier">moRelaxed</span><span class="Punctuation">)</span>
- <span class="Identifier">assert</span> <span class="Identifier">expected</span> <span class="Operator">==</span> <span class="DecNumber">7</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">load</span> <span class="Operator">==</span> <span class="DecNumber">5</span>
- <span class="Identifier">assert</span> <span class="Keyword">not</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">compareExchange</span><span class="Punctuation">(</span><span class="Identifier">expected</span><span class="Punctuation">,</span> <span class="DecNumber">12</span><span class="Punctuation">,</span> <span class="Identifier">moRelaxed</span><span class="Punctuation">,</span> <span class="Identifier">moRelaxed</span><span class="Punctuation">)</span>
- <span class="Identifier">assert</span> <span class="Identifier">expected</span> <span class="Operator">==</span> <span class="DecNumber">5</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">load</span> <span class="Operator">==</span> <span class="DecNumber">5</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">fetchAdd</span><span class="Punctuation">(</span><span class="DecNumber">1</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">5</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">fetchAdd</span><span class="Punctuation">(</span><span class="DecNumber">2</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">6</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">fetchSub</span><span class="Punctuation">(</span><span class="DecNumber">3</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">8</span>
- <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">atomicInc</span><span class="Punctuation">(</span><span class="DecNumber">1</span><span class="Punctuation">)</span>
- <span class="Identifier">assert</span> <span class="Identifier">loc</span><span class="Operator">.</span><span class="Identifier">load</span> <span class="Operator">==</span> <span class="DecNumber">6</span>
- <span class="Comment"># AtomicFlag</span>
- <span class="Keyword">var</span> <span class="Identifier">flag</span><span class="Punctuation">:</span> <span class="Identifier">AtomicFlag</span>
- <span class="Identifier">assert</span> <span class="Keyword">not</span> <span class="Identifier">flag</span><span class="Operator">.</span><span class="Identifier">testAndSet</span>
- <span class="Identifier">assert</span> <span class="Identifier">flag</span><span class="Operator">.</span><span class="Identifier">testAndSet</span>
- <span class="Identifier">flag</span><span class="Operator">.</span><span class="Identifier">clear</span><span class="Punctuation">(</span><span class="Identifier">moRelaxed</span><span class="Punctuation">)</span>
- <span class="Identifier">assert</span> <span class="Keyword">not</span> <span class="Identifier">flag</span><span class="Operator">.</span><span class="Identifier">testAndSet</span></pre></p>
- <div class="section" id="7">
- <h1><a class="toc-backref" href="#7">Types</a></h1>
- <dl class="item">
- <div id="Atomic">
- <dt><pre><a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span> {.<span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"std::atomic"</span><span class="Other">,</span> <span class="Identifier">completeStruct</span>.} <span class="Other">=</span> <span class="Keyword">object</span></pre></dt>
- <dd>
-
- An atomic object with underlying type <tt class="docutils literal"><span class="pre"><span class="Identifier">T</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L94" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L94" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="AtomicFlag">
- <dt><pre><a href="atomics.html#AtomicFlag"><span class="Identifier">AtomicFlag</span></a> {.<span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"std::atomic_flag"</span><span class="Other">,</span> <span class="Identifier">size</span><span class="Other">:</span> <span class="DecNumber">1</span>.} <span class="Other">=</span> <span class="Keyword">object</span></pre></dt>
- <dd>
-
- An atomic boolean state.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L98" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L98" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="MemoryOrder">
- <dt><pre><a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> {.<span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"std::memory_order"</span>.} <span class="Other">=</span> <span class="Keyword">enum</span>
- <span class="Identifier">moRelaxed</span><span class="Other">,</span> <span class="Comment">## No ordering constraints. Only the atomicity and ordering against</span>
- <span class="Comment">## other atomic operations is guaranteed.</span>
- <span class="Identifier">moConsume</span><span class="Other">,</span> <span class="Comment">## This ordering is currently discouraged as it's semantics are</span>
- <span class="Comment">## being revised. Acquire operations should be preferred.</span>
- <span class="Identifier">moAcquire</span><span class="Other">,</span> <span class="Comment">## When applied to a load operation, no reads or writes in the</span>
- <span class="Comment">## current thread can be reordered before this operation.</span>
- <span class="Identifier">moRelease</span><span class="Other">,</span> <span class="Comment">## When applied to a store operation, no reads or writes in the</span>
- <span class="Comment">## current thread can be reorderd after this operation.</span>
- <span class="Identifier">moAcquireRelease</span><span class="Other">,</span> <span class="Comment">## When applied to a read-modify-write operation, this behaves like</span>
- <span class="Comment">## both an acquire and a release operation.</span>
- <span class="Identifier">moSequentiallyConsistent</span> <span class="Comment">## Behaves like Acquire when applied to load, like Release when</span>
- <span class="Comment">## applied to a store and like AcquireRelease when applied to a</span>
- <span class="Comment">## read-modify-write operation.</span>
- <span class="Comment">## Also guarantees that all threads observe the same total ordering</span>
- <span class="Comment">## with other moSequentiallyConsistent operations.</span></pre></dt>
- <dd>
-
- Specifies how non-atomic operations can be reordered around atomic operations.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L62" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L62" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </dl>
- </div>
- <div class="section" id="12">
- <h1><a class="toc-backref" href="#12">Procs</a></h1>
- <dl class="item">
- <div id="+=-procs-all">
- <div id="+=,Atomic[T: SomeInteger],T">
- <dt><pre><span class="Keyword">proc</span> <a href="#%2B%3D%2CAtomic%5BT%3A%20SomeInteger%5D%2CT"><span class="Identifier">`+=`</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="system.html#SomeInteger"><span class="Identifier">SomeInteger</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">)</span> {.<span class="Identifier">inline</span>.}</pre></dt>
- <dd>
-
- Atomically increments the atomic integer by some <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L427" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L427" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="-=-procs-all">
- <div id="-=,Atomic[T: SomeInteger],T">
- <dt><pre><span class="Keyword">proc</span> <a href="#-%3D%2CAtomic%5BT%3A%20SomeInteger%5D%2CT"><span class="Identifier">`-=`</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="system.html#SomeInteger"><span class="Identifier">SomeInteger</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">)</span> {.<span class="Identifier">inline</span>.}</pre></dt>
- <dd>
-
- Atomically decrements the atomic integer by some <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L431" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L431" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="atomicDec-procs-all">
- <div id="atomicDec,Atomic[T: SomeInteger],T">
- <dt><pre><span class="Keyword">proc</span> <a href="#atomicDec%2CAtomic%5BT%3A%20SomeInteger%5D%2CT"><span class="Identifier">atomicDec</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="system.html#SomeInteger"><span class="Identifier">SomeInteger</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">T</span> <span class="Other">=</span> <span class="DecNumber">1</span><span class="Other">)</span> {.<span class="Identifier">inline</span>.}</pre></dt>
- <dd>
-
- Atomically decrements the atomic integer by some <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L423" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L423" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="atomicInc-procs-all">
- <div id="atomicInc,Atomic[T: SomeInteger],T">
- <dt><pre><span class="Keyword">proc</span> <a href="#atomicInc%2CAtomic%5BT%3A%20SomeInteger%5D%2CT"><span class="Identifier">atomicInc</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="system.html#SomeInteger"><span class="Identifier">SomeInteger</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">T</span> <span class="Other">=</span> <span class="DecNumber">1</span><span class="Other">)</span> {.<span class="Identifier">inline</span>.}</pre></dt>
- <dd>
-
- Atomically increments the atomic integer by some <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span></span></tt>.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L419" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L419" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="clear-procs-all">
- <div id="clear,AtomicFlag,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#clear%2CAtomicFlag%2CMemoryOrder"><span class="Identifier">clear</span></a><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#AtomicFlag"><span class="Identifier">AtomicFlag</span></a><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.clear(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Atomically sets the value of the atomic flag to false.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L157" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L157" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="compareExchange-procs-all">
- <div id="compareExchange,Atomic[T],T,T,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#compareExchange%2CAtomic%5BT%5D%2CT%2CT%2CMemoryOrder"><span class="Identifier">compareExchange</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">expected</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">T</span><span class="Other">;</span> <span class="Identifier">desired</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.compare_exchange_strong(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Atomically compares the value of the atomic object with the <tt class="docutils literal"><span class="pre"><span class="Identifier">expected</span></span></tt> value and performs exchange with the <tt class="docutils literal"><span class="pre"><span class="Identifier">desired</span></span></tt> one if equal or load if not. Returns true if the exchange was successful.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L114" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L114" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="compareExchange,Atomic[T],T,T,MemoryOrder,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#compareExchange%2CAtomic%5BT%5D%2CT%2CT%2CMemoryOrder%2CMemoryOrder"><span class="Identifier">compareExchange</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">expected</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">T</span><span class="Other">;</span> <span class="Identifier">desired</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">success</span><span class="Other">,</span> <span class="Identifier">failure</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.compare_exchange_strong(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Same as above, but allows for different memory orders for success and failure.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L119" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L119" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="compareExchangeWeak-procs-all">
- <div id="compareExchangeWeak,Atomic[T],T,T,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#compareExchangeWeak%2CAtomic%5BT%5D%2CT%2CT%2CMemoryOrder"><span class="Identifier">compareExchangeWeak</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">expected</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">desired</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.compare_exchange_weak(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Same as above, but is allowed to fail spuriously.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L123" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L123" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- <div id="compareExchangeWeak,Atomic[T],T,T,MemoryOrder,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#compareExchangeWeak%2CAtomic%5BT%5D%2CT%2CT%2CMemoryOrder%2CMemoryOrder"><span class="Identifier">compareExchangeWeak</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">expected</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">desired</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span> <span class="Identifier">success</span><span class="Other">,</span> <span class="Identifier">failure</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.compare_exchange_weak(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Same as above, but allows for different memory orders for success and failure.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L126" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L126" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="exchange-procs-all">
- <div id="exchange,Atomic[T],T,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#exchange%2CAtomic%5BT%5D%2CT%2CMemoryOrder"><span class="Identifier">exchange</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">desired</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">T</span> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.exchange(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Atomically replaces the value of the atomic object with the <tt class="docutils literal"><span class="pre"><span class="Identifier">desired</span></span></tt> value and returns the old value.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L110" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L110" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="fence-procs-all">
- <div id="fence,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#fence%2CMemoryOrder"><span class="Identifier">fence</span></a><span class="Other">(</span><span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a><span class="Other">)</span> {.<span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"std::atomic_thread_fence(@)"</span><span class="Other">,</span>
- <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Ensures memory ordering without using atomic operations.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L160" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L160" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="fetchAdd-procs-all">
- <div id="fetchAdd,Atomic[T: SomeInteger],T,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#fetchAdd%2CAtomic%5BT%3A%20SomeInteger%5D%2CT%2CMemoryOrder"><span class="Identifier">fetchAdd</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="system.html#SomeInteger"><span class="Identifier">SomeInteger</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">T</span> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.fetch_add(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Atomically adds a <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span></span></tt> to the atomic integer and returns the original value.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L132" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L132" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="fetchAnd-procs-all">
- <div id="fetchAnd,Atomic[T: SomeInteger],T,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#fetchAnd%2CAtomic%5BT%3A%20SomeInteger%5D%2CT%2CMemoryOrder"><span class="Identifier">fetchAnd</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="system.html#SomeInteger"><span class="Identifier">SomeInteger</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">T</span> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.fetch_and(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Atomically replaces the atomic integer with it's bitwise AND with the specified <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span></span></tt> and returns the original value.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L140" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L140" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="fetchOr-procs-all">
- <div id="fetchOr,Atomic[T: SomeInteger],T,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#fetchOr%2CAtomic%5BT%3A%20SomeInteger%5D%2CT%2CMemoryOrder"><span class="Identifier">fetchOr</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="system.html#SomeInteger"><span class="Identifier">SomeInteger</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">T</span> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.fetch_or(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Atomically replaces the atomic integer with it's bitwise OR with the specified <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span></span></tt> and returns the original value.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L144" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L144" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="fetchSub-procs-all">
- <div id="fetchSub,Atomic[T: SomeInteger],T,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#fetchSub%2CAtomic%5BT%3A%20SomeInteger%5D%2CT%2CMemoryOrder"><span class="Identifier">fetchSub</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="system.html#SomeInteger"><span class="Identifier">SomeInteger</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">T</span> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.fetch_sub(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Atomically subtracts a <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span></span></tt> to the atomic integer and returns the original value.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L136" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L136" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="fetchXor-procs-all">
- <div id="fetchXor,Atomic[T: SomeInteger],T,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#fetchXor%2CAtomic%5BT%3A%20SomeInteger%5D%2CT%2CMemoryOrder"><span class="Identifier">fetchXor</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="system.html#SomeInteger"><span class="Identifier">SomeInteger</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">T</span> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.fetch_xor(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Atomically replaces the atomic integer with it's bitwise XOR with the specified <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span></span></tt> and returns the original value.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L148" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L148" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="load-procs-all">
- <div id="load,Atomic[T],MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#load%2CAtomic%5BT%5D%2CMemoryOrder"><span class="Identifier">load</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">T</span> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.load(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Atomically obtains the value of the atomic object.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L103" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L103" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="signalFence-procs-all">
- <div id="signalFence,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#signalFence%2CMemoryOrder"><span class="Identifier">signalFence</span></a><span class="Other">(</span><span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a><span class="Other">)</span> {.<span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"std::atomic_signal_fence(@)"</span><span class="Other">,</span>
- <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Prevents reordering of accesses by the compiler as would fence, but inserts no CPU instructions for memory ordering.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L163" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L163" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="store-procs-all">
- <div id="store,Atomic[T],T,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#store%2CAtomic%5BT%5D%2CT%2CMemoryOrder"><span class="Identifier">store</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#Atomic"><span class="Identifier">Atomic</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">desired</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.store(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Atomically replaces the value of the atomic object with the <tt class="docutils literal"><span class="pre"><span class="Identifier">desired</span></span></tt> value.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L106" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L106" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- <div id="testAndSet-procs-all">
- <div id="testAndSet,AtomicFlag,MemoryOrder">
- <dt><pre><span class="Keyword">proc</span> <a href="#testAndSet%2CAtomicFlag%2CMemoryOrder"><span class="Identifier">testAndSet</span></a><span class="Other">(</span><span class="Identifier">location</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="atomics.html#AtomicFlag"><span class="Identifier">AtomicFlag</span></a><span class="Other">;</span>
- <span class="Identifier">order</span><span class="Other">:</span> <a href="atomics.html#MemoryOrder"><span class="Identifier">MemoryOrder</span></a> <span class="Other">=</span> <span class="Identifier">moSequentiallyConsistent</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.
- <span class="Identifier">importcpp</span><span class="Other">:</span> <span class="StringLit">"#.test_and_set(@)"</span><span class="Other">,</span> <span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">"<atomic>"</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
- <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
- <dd>
-
- Atomically sets the atomic flag to true and returns the original value.
- <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/concurrency/atomics.nim#L154" class="link-seesrc" target="_blank">Source</a>
- <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/atomics.nim#L154" class="link-seesrc" target="_blank" >Edit</a>
- </dd>
- </div>
- </div>
- </dl>
- </div>
- </div>
- </div>
- <div class="twelve-columns footer">
- <span class="nim-sprite"></span>
- <br>
- <small style="color: var(--hint);">Made with Nim. Generated: 2025-01-09 12:00:21 UTC</small>
- </div>
- </div>
- </div>
- <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
-
- </body>
- </html>
|