{"id":25815766,"url":"https://github.com/durban/choam","last_synced_at":"2026-05-30T01:05:55.253Z","repository":{"id":65508439,"uuid":"321122646","full_name":"durban/choam","owner":"durban","description":"Experiments with composable lock-free concurrency","archived":false,"fork":false,"pushed_at":"2026-05-28T22:05:07.000Z","size":10349,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-29T00:08:26.066Z","etag":null,"topics":["cats-effect","concurrency","concurrent-programming","fp","functional-programming","scala","software-transactional-memory","stm"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/durban.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE.txt","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-12-13T17:38:27.000Z","updated_at":"2026-03-12T21:48:58.000Z","dependencies_parsed_at":"2023-02-16T13:15:27.798Z","dependency_job_id":"e0db1d75-5ac0-4840-9e6b-9e7d8d80b952","html_url":"https://github.com/durban/choam","commit_stats":{"total_commits":1546,"total_committers":1,"mean_commits":1546.0,"dds":0.0,"last_synced_commit":"e8513ed166e035d6dcd9a3ac526c9e054fb492ab"},"previous_names":[],"tags_count":94,"template":false,"template_full_name":null,"purl":"pkg:github/durban/choam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durban%2Fchoam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durban%2Fchoam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durban%2Fchoam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durban%2Fchoam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/durban","download_url":"https://codeload.github.com/durban/choam/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durban%2Fchoam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33676200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cats-effect","concurrency","concurrent-programming","fp","functional-programming","scala","software-transactional-memory","stm"],"created_at":"2025-02-28T04:37:08.289Z","updated_at":"2026-05-30T01:05:55.245Z","avatar_url":"https://github.com/durban.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n\n   SPDX-License-Identifier: Apache-2.0\n   Copyright 2016-2026 Daniel Urban and contributors listed in NOTICE.txt\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n---\u003e\n\n# CHOAM\n\n\u003c!-- TODO: after 0.5 is released:\n[![choam-core version](https://index.scala-lang.org/durban/choam/choam-core/latest.svg)](https://index.scala-lang.org/durban/choam/choam-core)\n--\u003e\n\n*Experiments with composable lock-free concurrency*\n\n## Overview\n\nThe type [`Rxn[+A]`](core/shared/src/main/scala/dev/tauri/choam/core/Rxn.scala)\nis an effect type with result type `A`. Thus, it is similar to, e.g., `IO[A]`, but:\n\n- The only effect it can perform is lock-free updates to\n  [`Ref`s](core/shared/src/main/scala/dev/tauri/choam/refs/Ref.scala)\n  (mutable memory locations with a pure API).\n  - For example, if `x` is a `Ref[Int]`, then `x.update(_ + 1)` is a `Rxn[Unit]` which\n    (when executed) will increment its value.\n- Multiple `Rxn`s can be composed (by using various combinators),\n  and the resulting `Rxn` will *update all affected memory locations atomically*.\n  - For example, if `y` is also a `Ref[Int]`, then `x.update(_ + 1) *\u003e y.update(_ + 1)`\n    will increment both of them *atomically*.\n\n## Getting started\n\n```scala\nlibraryDependencies += \"dev.tauri\" %%% \"choam-core\" % \"0.5.0-RC7\"\n```\n\nThe `choam-core` module contains the fundamental types for working with `Rxn`s.\nFor more modules, see [below](#modules).\n\nThe complete version of the example [above](#overview), (which increments the value of\ntwo `Ref`s) is as follows:\n\n\u003c!-- Note: ⇩ this needs to be kept in sync with `ReadmeSpec`! --\u003e\n```scala\nimport dev.tauri.choam.core.{ Rxn, Ref }\n\ndef incrBoth(x: Ref[Int], y: Ref[Int]): Rxn[Unit] = {\n  x.update(_ + 1) *\u003e y.update(_ + 1)\n}\n```\n\u003c!-- Note: ⇧ this needs to be kept in sync with `ReadmeSpec`! --\u003e\n\nAs an example, we can execute it with `cats.effect.IO` like this\n(the `choam-ce` module is also needed):\n\n\u003c!-- Note: ⇩ this needs to be kept in sync with `ReadmeSpec`! --\u003e\n```scala\nimport cats.effect.{ IO, IOApp }\nimport dev.tauri.choam.ce.RxnAppMixin\n\nobject MyMain extends IOApp.Simple with RxnAppMixin {\n  override def run: IO[Unit] = for {\n    // create two refs:\n    x \u003c- Ref(0).run[IO]\n    y \u003c- Ref(42).run[IO]\n    // increment their values atomically:\n    _ \u003c- incrBoth(x, y).run[IO]\n    // check that it happened:\n    xv \u003c- x.get.run[IO]\n    yv \u003c- y.get.run[IO]\n    _ \u003c- IO {\n      assert(xv == 1)\n      assert(yv == 43)\n    }\n  } yield ()\n}\n```\n\u003c!-- Note: ⇧ this needs to be kept in sync with `ReadmeSpec`! --\u003e\n\n## Software Transactional Memory (STM) [_work in progress_]\n\nAs noted [below](#related-work), `Rxn` is not a full-featured STM implementation (notably,\nit lacks condition synchronization). However, the `dev.tauri.choam.stm` package contains a\nfull-blown STM, built on top of `Rxn`. For now, this package is experimental (i.e., no\nbackwards compatibility), and also lacks some basic features, but it _does_ have condition\nsynchronization (see `Txn.retry` and `Txn#orElse`).\n\n## Modules\n\n- [`choam-core`](core/shared/src/main/scala/dev/tauri/choam/):\n  - core types, like\n    [`Rxn`](core/shared/src/main/scala/dev/tauri/choam/core/Rxn.scala) and\n    [`Ref`](core/shared/src/main/scala/dev/tauri/choam/core/Ref.scala)\n  - integration with effect types implementing the\n    [Cats Effect](https://github.com/typelevel/cats-effect) typeclasses\n    (specifically `Sync`/`Async`)\n  - _experimental_ software transactional memory (STM) built on `Rxn`\n- [`choam-data`](data/shared/src/main/scala/dev/tauri/choam/data/):\n  concurrent data structures built on `Rxn`\n  - Examples: queues, stacks, hash- and ordered maps and sets\n- [`choam-async`](async/shared/src/main/scala/dev/tauri/choam/async/):\n  - Asynchronous data structures; some of their operations are possibly\n    *semantically* blocking (i.e., [fiber blocking\n    ](https://typelevel.org/cats-effect/docs/thread-model#fiber-blocking-previously-semantic-blocking)),\n    and so are in an `F[_] : Async` (note, that these `F[A]` operations are – obviously – *not* lock-free)\n  - These data structures (typically) also have some (lock-free) `Rxn` operations; thus they\n    provide a \"bridge\" between the (synchronous, lock-free) `Rxn` \"world\", and the (asynchronous) `F[_]` \"world\".\n  - \u003ca name=\"promise\"\u003e\u003c/a\u003eThe simplest example is the data type `dev.tauri.choam.async.Promise`, which can be\n    completed as a `Rxn`, and can be waited on as an async `F[_]`:\n      ```scala\n      trait Promise[A] { // simplified API\n        def complete(a: A): Rxn[Boolean]\n        def get[F[_]]: F[A]\n      }\n      ```\n\n- [`choam-stream`](stream/shared/src/main/scala/dev/tauri/choam/stream/):\n  integration with `fs2.Stream`s\n- [`choam-ce`](ce/shared/src/main/scala/dev/tauri/choam/ce/):\n  integration with `cats.effect.IOApp` (for convenience)\n- [`choam-zi`](zi/shared/src/main/scala/dev/tauri/choam/zi/):\n  integration with `zio.ZIOApp` (for convenience)\n- [`choam-profiler`](profiler/src/main/scala/dev/tauri/choam/profiler/):\n  JMH profiler \"plugin\" for `Rxn` statistics/measurements; enable it with\n  `-prof dev.tauri.choam.profiler.RxnProfiler`.\n- Internal modules (don't use them directly):\n  - [`choam-mcas`](mcas/shared/src/main/scala/dev/tauri/choam/internal/mcas/):\n    low-level multi-word compare-and-swap (MCAS/*k*-CAS) implementations\n  - [`choam-internal`](internal/shared/src/main/scala/dev/tauri/choam/internal/):\n    a concurrent skip list map and other utilities for internal use\n  - [`choam-laws`](laws/shared/src/main/scala/dev/tauri/choam/laws/):\n    properties fulfilled by the various `Rxn` combinators\n\nJARs are on Maven Central. Browsable Scaladoc is available [here](https://tauri.dev/choam/api).\n\n## Related work\n\n- Our `Rxn` is an extended version of *reagents*, described in [the Reagents paper][1][^1]\n  (originally implemented [in Scala](https://github.com/aturon/ChemistrySet); see also other\n  implementations [in OCaml](https://github.com/ocaml-multicore/reagents) and [in Racket](https://github.com/aturon/Caper).)\n  The main diferences from the paper are:\n  - Only lock-free features (and a few low-level ones) are implemented.\n  - `Rxn` has a referentially transparent (\"purely functional\" / \"programs as values\") monadic API.\n    (A limited imperative API is also available in the `dev.tauri.choam.unsafe` package.)\n  - The interpreter (that executes `Rxn`s) is stack-safe.\n  - Composing `Rxn`s which modify the same `Ref` also works fine\n    (thus, an `Rxn` is closer to an STM transaction than a *reagent*;\n    see below).\n  - Reads are _always_ guaranteed to be consistent (this is usually called *opacity*, see below).\n\n[1]: https://www.ccs.neu.edu/home/turon/reagents.pdf\n[^1]: Turon, Aaron. \"Reagents: expressing and composing fine-grained concurrency.\" In Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 157-168. 2012.\n\n- Multi-word compare-and-swap (MCAS/*k*-CAS) implementations:\n  - In an earlier version we used [CASN by Harris et al.][2][^2], also known as the HFP algorithm.\n  - The current version uses [EMCAS by Guerraoui et al.][3][^3] (also known as the GKMZ algorithm);\n    `Mcas.Emcas` implements a variant of this algorithm, this is the default algorithm we use on the JVM\n    (and Scala Native); on JS we use a trivial single-threaded algorithm.\n  - A simple, non-lock-free algorithm from [the Reagents paper][1][^1] is implemented as\n    `Mcas.SpinLockMcas` (we use it for testing).\n  - Our optimization for read-only entries (i.e., entries *only* in the read-set) is similar to the one used\n    by [PathCAS by Brown et al.][4][^4]. The proof of correctness and lock-freedom is also very similar (although\n    we use an algorithm to detect cyclic helping similar to [Dreadlocks by Koskinen et al.][5][^5]).\n\n[2]: https://www.cl.cam.ac.uk/research/srg/netos/papers/2002-casn.pdf\n[^2]: Harris, Timothy L., Keir Fraser, and Ian A. Pratt. \"A practical multi-word compare-and-swap operation.\" In Distributed Computing: 16th International Conference, DISC 2002 Toulouse, France, October 28–30, 2002 Proceedings 16, pp. 265-279. Springer Berlin Heidelberg, 2002.\n\n[3]: https://arxiv.org/pdf/2008.02527.pdf\n[^3]: Guerraoui, Rachid, Alex Kogan, Virendra J. Marathe, and Igor Zablotchi. \"Efficient Multi-Word Compare and Swap.\" In 34th International Symposium on Distributed Computing. 2020.\n\n[4]: https://dl.acm.org/doi/pdf/10.1145/3503221.3508410\n[^4]: Brown, Trevor, William Sigouin, and Dan Alistarh. \"PathCAS: an efficient middle ground for concurrent search data structures.\" Proceedings of the 27th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. 2022.\n\n[5]: https://dl.acm.org/doi/pdf/10.1145/1378533.1378585\n[^5]: Koskinen, Eric, and Maurice Herlihy. \"Dreadlocks: efficient deadlock detection.\" Proceedings of the twentieth annual symposium on Parallelism in algorithms and architectures. 2008.\n\n- Software transactional memory (STM)\n  - A `Rxn` is somewhat similar to an STM transaction. (In fact, `Rxn` could be seen as a lock-free STM; but without\n    condition synchronization, exceptions, and other fancy things.) The differences between `Rxn` and typical STMs are:\n    - A `Rxn` is lock-free by construction (but see [below](#lock-freedom)); STM transactions are not (necessarily)\n      lock-free (see, e.g., the \"retry\" STM operation, called [\"modular blocking\" in Haskell][6][^6]).\n    - As a consequence of the previous point, `Rxn` cannot be used to implement\n      \"inherently non-lock-free\" logic (e.g., asynchronously waiting on a\n      condition set by another thread/fiber/similar, i.e., condition synchronization).\n      However, `Rxn` is interoperable with async data types which implement\n      [Cats Effect](https://github.com/typelevel/cats-effect) typeclasses\n      (see the `choam-async` module). This feature can be used to provide such\n      \"waiting\" functionality (e.g., with the `dev.tauri.choam.async.Promise` type,\n      see [above](#promise)).\n    - The implementation (the `Rxn` interpreter) is also lock-free; STM implementations\n      usually use fine-grained locking (although there are exceptions).\n    - STM transactions usually have a way of raising/handling errors\n      (e.g., `MonadError`); `Rxn` has no such feature (beyond an uncatchable `panic`),\n      but of course return values can encode errors with `Option`, `Either`, or similar.\n    - Some STM systems allow access to transactional memory from\n      non-transactional code; `Rxn` doesn't support this, the contents of a\n      `Ref[A]` can only be accessed from inside a `Rxn`.\n  - Similarities between `Rxn`s and STM transactions include the following:\n    - Atomicity, consistency and isolation.\n    - `Rxn` also provides a correctness property called\n      [*opacity*][7][^7]; see a short introduction [here][opacity_intro].\n      A lot of STM implementations also guarantee this property (e.g., ScalaSTM),\n      but not all of them. Opacity basically guarantees that all observed values\n      are consistent with each other, even in running `Rxn`s (some STM systems only\n      guarantee such consistency for transactions which actually commit).\n    - (We might technically weaken the *opacity* property in the future to [TMS1][8][^8];\n      this should be unobservable to code not using `unsafe` APIs.)\n  - Some STM implementations:\n    - Haskell: [`Control.Concurrent.STM`](https://hackage.haskell.org/package/stm).\n    - Scala:\n      [Cats STM](https://github.com/TimWSpence/cats-stm),\n      [`kyo-stm`](https://github.com/getkyo/kyo/tree/main/kyo-stm/shared/src/main/scala/kyo),\n      [ScalaSTM](https://github.com/scala-stm/scala-stm),\n      [ZSTM](https://github.com/zio/zio/tree/series/2.x/core/shared/src/main/scala/zio/stm).\n    - Kotlin: [`arrow-fx-stm`](https://arrow-kt.io/learn/coroutines/stm).\n    - OCaml: [Kcas](https://github.com/ocaml-multicore/kcas).\n    - [TL2][9][^9] and [SwissTM][10][^10]:\n      the system which guarantees *opacity* (see above) for `Rxn`s is based on\n      the one in SwissTM (which is itself based on the one in TL2). However, TL2 and SwissTM\n      are lock-based STM implementations; our implementation is lock-free.\n    - We also use some ideas from the [Commit Phase Variations paper][11][^11].\n\n[6]: https://dl.acm.org/doi/pdf/10.1145/1378704.1378725\n[^6]: Harris, Tim, Simon Marlow, Simon Peyton-Jones, and Maurice Herlihy. \"Composable memory transactions.\" In Proceedings of the tenth ACM SIGPLAN symposium on Principles and practice of parallel programming, pp. 48-60. 2005.\n\n[7]: https://infoscience.epfl.ch/record/114303/files/opacity-ppopp08.pdf\n[^7]: Guerraoui, Rachid, and Michal Kapalka. \"On the correctness of transactional memory.\" In Proceedings of the 13th ACM SIGPLAN Symposium on Principles and practice of parallel programming, pp. 175-184. 2008.\n\n[opacity_intro]: https://nbronson.github.io/scala-stm/semantics.html#opacity\n\n[8]: https://dl.acm.org/doi/pdf/10.1007/s00165-012-0225-8\n[^8]: Doherty, S., Groves, L., Luchangco, V. et al. Towards formally specifying and verifying transactional memory. Form Asp Comp 25, 769–799 (2013).\n\n[9]: https://disco.ethz.ch/courses/fs11/seminar/paper/johannes-2-1.pdf\n[^9]: Dice, Dave, Ori Shalev, and Nir Shavit. \"Transactional locking II.\" In International Symposium on Distributed Computing, pp. 194-208. Berlin, Heidelberg: Springer Berlin Heidelberg, 2006.\n\n[10]: https://infoscience.epfl.ch/server/api/core/bitstreams/6b454d6b-0ae9-4b37-b341-6e2d092aef8e/content\n[^10]: Dragojević, Aleksandar, Rachid Guerraoui, and Michal Kapalka. \"Stretching transactional memory.\" ACM sigplan notices 44, no. 6 (2009): 155-165.\n\n[11]: https://repository.rice.edu/server/api/core/bitstreams/ec929767-5e4b-4c8e-9704-c649bf6328c9/content\n[^11]: Zhang, Rui, Zoran Budimlic, and William N. Scherer III. Commit phase variations in timestamp-based software transactional memory. Technical Report TR08-03, Rice University, 2008.\n\n## Compatibility and assumptions\n\n### General assumptions\n\nThroughout the library, we are assuming the following:\n\n- Instances of the `scala.FunctionN` traits passed to the library are pure and total\n- APIs in `*.internal.*` packages are not used directly\n- The library is used from Scala (and not, e.g., Java)\n- Cats Effect type classes and data types are used as intended\n  - e.g., all uses of `cats.effect.kernel.Resource`s are finished before closing them\n- No dynamic type tests are performed by user code on objects provided by the library\n  - i.e., the dynamic type of these objects is not part of their public API\n  - e.g., don't do this:\n    ```scala\n    def foo(ref: dev.tauri.choam.core.Ref[String]) = ref match { // DON'T do this\n      case ar: java.util.concurrent.atomic.AtomicReference[_] =\u003e\n        ... // use `ar`\n    }\n    ```\n- As a special case of the previous point: no object identity tests (`eq`) are performed\n  to recover static type information of objects provided by the library\n- References passed to the library are non-`null`:\n  - The library usually dereferences the references passed to it without defensive `null` checks.\n  - On the JVM (and Scala Native), this works as expected: if something is `null`,\n    but it shouldn't be, the result is a `NullPointerException` being thrown (such\n    exceptions should be expected in these cases).\n  - On Scala.js however, dereferencing `null` is\n    [undefined behavior](https://www.scala-js.org/doc/semantics.html#undefined-behaviors);\n    thus, we recommend configuring `scalaJSLinkerConfig` to be `Compliant` (see there),\n    or otherwise guaranteeing that `null`s aren't passed to the library.\n  - For example, `Reactive#run` expects the `Rxn` passed to it to be non-`null`, and\n    doesn't perform any defensive `null` checks on it.\n  - An exception to this rule: a generic payload being `null` is completely fine,\n    e.g., storing `null` in a `Ref[String]` or `Queue[String]` works correctly.\n\n### Backwards compatibility\n\n[\"Early\" SemVer 2.0.0](https://www.scala-lang.org/blog/2021/02/16/preventing-version-conflicts-with-versionscheme.html#early-semver-and-sbt-version-policy) _binary_ backwards compatibility, with the following exceptions:\n\n- The versions of `choam-` modules must match *exactly* (e.g., *don't* use `\"choam-data\" % \"0.4.1\"`\n  with `\"choam-core\" % \"0.4.0\"`).\n  - In sbt ⩾ 1.10.0 this can be ensured like this:\n    ```scala\n    csrSameVersions += Set(sbt.librarymanagement.InclExclRule(\"dev.tauri\", \"choam-*\"))\n    ```\n- There is no backwards compatibility when:\n  - using APIs which are non-public in Scala (even though some of these are public in the bytecode);\n  - inheriting/`match`ing `sealed` classes/traits (even though this may not be enforced by the bytecode);\n  - using `*.internal.*` packages (e.g., `dev.tauri.choam.internal.mcas`);\n  - using `unsafe` APIs (e.g., `Rxn.unsafe.retry` or the contents of the `dev.tauri.choam.unsafe` package).\n  - using the contents of the `dev.tauri.choam.stm` package (our STM is experimental for now)\n- There is no backwards compatibility for these modules:\n  - `choam-ce`\n  - `choam-zi`\n  - `choam-mcas`\n  - `choam-internal`\n  - `choam-laws`\n  - `choam-stream`\n  - `choam-profiler`\n  - `choam-docs`\n  - (and all unpublished modules)\n- There is no backwards compatibility for \"hash\" versions (e.g., `0.4-39d987a` or `0.4.3-2-39d987a`).\n- See also the next section (platforms).\n\n### Platforms:\n\n- Scala platforms:\n  - JVM:\n    - versions ⩾ 17\n    - tested on OpenJDK, Graal, and OpenJ9 (but should work on others)\n    - for secure random number generation, either the `Windows-PRNG`\n      or (`/dev/random` and `/dev/urandom`) need to be available\n  - Scala.js:\n    - works, but not really interesting (we assume no multithreading)\n    - provided to make cross-compiling easier for projects which use CHOAM\n    - for secure random number generation, a `java.security.SecureRandom`\n      implementation needs to be available (see [here](https://github.com/scala-js/scala-js-java-securerandom))\n  - Scala Native:\n    - completely experimental\n    - completely untested on Windows\n    - no backwards compatibility\n- Scala versions:\n  - 2.13\n  - 3 LTS\n\n### Lock-freedom\n\n`Rxn`s are lock-free by construction, if the following assumptions hold\n(in addition to the [general assumptions above](#general-assumptions)):\n\n- No \"infinite loops\" are created (e.g., by infinitely recursive `flatMap`s)\n- No `unsafe` operations are used (e.g., `Rxn.unsafe.retry` is obviously not lock-free)\n- We assume that certain JVM operations are lock-free; some examples are:\n  - `VarHandle` operations (e.g., `compareAndSet`)\n    - in practice, this is true on 64-bit platforms\n    - on 32-bit platforms some of these *might* use a lock\n  - GC and classloading\n    - in practice, the GC sometimes probably uses locks\n    - and classloaders sometimes also might use locks\n  - `ThreadLocalRandom`, `ThreadLocal`\n- Certain `Rxn` operations require extra assumptions:\n  - `Rxn.slowRandom` and `UUIDGen` use the OS RNG; in practice this might block\n    (although we *really* try to use the non-blocking ones)\n  - in `AsyncReactive` we assume that calling a Cats Effect `Async` callback is lock-free\n    (in `cats.effect.IO`, as of version 3.6.3, this is not technically true)\n- Executing a `Rxn` with a `Rxn.Strategy` other than `Rxn.Strategy.Spin`\n  is not necessarily lock-free\n- Only the default `Mcas` is lock-free, other `Mcas` implementations may not be\n\nAlso note, that while `Rxn` operations are lock-free (if these assumptions hold),\noperations in an async `F[_]` effect might not be lock-free (an obvious example is\n`Promise#get`, which is a possibly [fiber blocking\n](https://typelevel.org/cats-effect/docs/thread-model#fiber-blocking-previously-semantic-blocking)\nasync `F[A]`, and *not* a `Rxn`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurban%2Fchoam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdurban%2Fchoam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurban%2Fchoam/lists"}