# \#concurrency

**URL:** https://discuss.ocaml.org/tag/concurrency/310.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [Liquidsoap 2.5.x: a practical study of OCaml 5.x concurrency](https://discuss.ocaml.org/t/liquidsoap-2-5-x-a-practical-study-of-ocaml-5-x-concurrency/18525)

<div class="topic-metadata">

**Author:** [@toots](https://discuss.ocaml.org/u/toots)\
**Replies:** 0\
**Last updated:** [September 11, 2026, 11:16pm UTC](https://discuss.ocaml.org/t/liquidsoap-2-5-x-a-practical-study-of-ocaml-5-x-concurrency/18525 "2026-09-11T23:16:19Z")

</div>

\[Full disclosure: some of the code and content linked below was done with the help of automated tools. This post is not.\] After a few years holding off on it, it was finally time to do the migration to OCaml 5 for the l…

---

## [\[ANN\] Affect 0.0.0 – A streamlined and natural concurrency model for OCaml](https://discuss.ocaml.org/t/ann-affect-0-0-0-a-streamlined-and-natural-concurrency-model-for-ocaml/18451)

<div class="topic-metadata">

**Author:** [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Replies:** 2\
**Last updated:** [August 12, 2026, 11:56am UTC](https://discuss.ocaml.org/t/ann-affect-0-0-0-a-streamlined-and-natural-concurrency-model-for-ocaml/18451 "2026-08-12T11:56:44Z")

</div>

Hello, It’s my pleasure to announce the first release of affect: Affect is a streamlined and natural concurrency model for OCaml. It provides parallel asynchronous functions and first-class synchronous actions to orc…

---

## [Notty+Unix socket in separate domains: UI update stop for some reason](https://discuss.ocaml.org/t/notty-unix-socket-in-separate-domains-ui-update-stop-for-some-reason/17911)

<div class="topic-metadata">

**Author:** [@Kakadu](https://discuss.ocaml.org/u/Kakadu)\
**Replies:** 2\
**Last updated:** [March 24, 2026, 11:04am UTC](https://discuss.ocaml.org/t/notty-unix-socket-in-separate-domains-ui-update-stop-for-some-reason/17911 "2026-03-24T11:04:57Z")

</div>

This is my first time experimenting with Notty, and the goal is to implement a monitoring systems that receives something via Unix socket and paints it. I used this notty demo because it uses timer to periodically upda…

---

## [Waiting in Eio for socket data without reading it](https://discuss.ocaml.org/t/waiting-in-eio-for-socket-data-without-reading-it/17615)

<div class="topic-metadata">

**Author:** [@vog](https://discuss.ocaml.org/u/vog)\
**Replies:** 1\
**Last updated:** [December 20, 2025, 2:35pm UTC](https://discuss.ocaml.org/t/waiting-in-eio-for-socket-data-without-reading-it/17615 "2025-12-20T14:35:11Z")

</div>

I’d like to wrap a C library for use within Eio code. That library opens a network connection on its own, but I’m able to fetch the file descriptor of the open socket. It even operates in non-blocking mode. But how do I…

---

## [How to safely take from multiple Eio streams?](https://discuss.ocaml.org/t/how-to-safely-take-from-multiple-eio-streams/17405)

<div class="topic-metadata">

**Author:** [@derekchiang](https://discuss.ocaml.org/u/derekchiang)\
**Replies:** 3\
**Last updated:** [October 18, 2025, 10:31pm UTC](https://discuss.ocaml.org/t/how-to-safely-take-from-multiple-eio-streams/17405 "2025-10-18T22:31:13Z")

</div>

I’m new to concurrency programming in OCaml and I’m currently playing with Eio streams, which I understand are similar to channels in Go. In Go, if I have multiple channels to receive from, I would use select like this: …

---

## [Concurrency in Ocaml: It seems like the CML style never took off for anybody?](https://discuss.ocaml.org/t/concurrency-in-ocaml-it-seems-like-the-cml-style-never-took-off-for-anybody/3819)

<div class="topic-metadata">

**Author:** [@Chet\_Murthy](https://discuss.ocaml.org/u/Chet_Murthy)\
**Replies:** 12\
**Last updated:** [March 27, 2025, 11:28pm UTC](https://discuss.ocaml.org/t/concurrency-in-ocaml-it-seems-like-the-cml-style-never-took-off-for-anybody/3819 "2025-03-27T23:28:23Z")

</div>

\[Full disclosure: I’m pretty much a threads/mutex/condvar hacker myself, having spent too many years putting out Java server dumpster-fires to really be able to switch to one of these other styles the Kids These Days com…

---

## [\[ANN\] Ocsigen migrating to effect-based concurrency?](https://discuss.ocaml.org/t/ann-ocsigen-migrating-to-effect-based-concurrency/16327)

<div class="topic-metadata">

**Author:** [@Vincent\_Balat](https://discuss.ocaml.org/u/Vincent_Balat)\
**Replies:** 7\
**Last updated:** [March 20, 2025, 8:47am UTC](https://discuss.ocaml.org/t/ann-ocsigen-migrating-to-effect-based-concurrency/16327 "2025-03-20T08:47:17Z")

</div>

We’re delighted to announce that the Ocsigen project has just launched one of its most ambitious changes: moving from Lwt to effects-based concurrency. If this experiment goes well, it will be another step towards simpl…

---

## [\[ANN\] Bytesrw 0.1.0 – Composable byte stream readers and writers](https://discuss.ocaml.org/t/ann-bytesrw-0-1-0-composable-byte-stream-readers-and-writers/15696)

<div class="topic-metadata">

**Author:** [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Replies:** 9\
**Last updated:** [January 14, 2025, 2:11pm UTC](https://discuss.ocaml.org/t/ann-bytesrw-0-1-0-composable-byte-stream-readers-and-writers/15696 "2025-01-14T14:11:15Z")

</div>

Hello, It’s my pleasure to announce the first release of the bytesrw library: Bytesrw extends the OCaml Bytes module with composable, memory efficient, byte stream readers and writers compatible with effect-based conc…

---

## [On concurrency models](https://discuss.ocaml.org/t/on-concurrency-models/15899)

<div class="topic-metadata">

**Author:** [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Replies:** 19\
**Last updated:** [January 13, 2025, 8:55am UTC](https://discuss.ocaml.org/t/on-concurrency-models/15899 "2025-01-13T08:55:04Z")

</div>

Indeed it’s the only way to get to a real compositional, multi-core friendly eco-system. It’s quite clear that the current breed of multi-core abstractions and their various pools, is totally ill suited. And picos, des…

---

## [Best practices and design patterns for supporting concurrent IO in libraries](https://discuss.ocaml.org/t/best-practices-and-design-patterns-for-supporting-concurrent-io-in-libraries/15001)

<div class="topic-metadata">

**Author:** [@zoj613](https://discuss.ocaml.org/u/zoj613)\
**Replies:** 6\
**Last updated:** [September 9, 2024, 3:34am UTC](https://discuss.ocaml.org/t/best-practices-and-design-patterns-for-supporting-concurrent-io-in-libraries/15001 "2024-09-09T03:34:39Z")

</div>

I am interested in learning about the best practices and recommended design patterns in 2024 for supporting concurrent IO in libraries. I noticed that several libraries release two packages, one using synchorious IO and …

---

## [Sharing: newbie caught out by dumb mistake with promises](https://discuss.ocaml.org/t/sharing-newbie-caught-out-by-dumb-mistake-with-promises/14910)

<div class="topic-metadata">

**Author:** [@R\_Huxton](https://discuss.ocaml.org/u/R_Huxton)\
**Replies:** 0\
**Last updated:** [July 6, 2024, 8:36am UTC](https://discuss.ocaml.org/t/sharing-newbie-caught-out-by-dumb-mistake-with-promises/14910 "2024-07-06T08:36:21Z")

</div>

I had a trivial little Lwt program like this: let read\_name = let%lwt name = Lwt\_io.(read\_line stdin) in Lwt.return (Some name) let timeout = let%lwt () = Lwt\_unix.sleep 3.0 in Lwt.return None let () = print…

---

## [Eio, streams, clean termination](https://discuss.ocaml.org/t/eio-streams-clean-termination/14811)

<div class="topic-metadata">

**Author:** [@R\_Huxton](https://discuss.ocaml.org/u/R_Huxton)\
**Replies:** 4\
**Last updated:** [June 19, 2024, 10:14am UTC](https://discuss.ocaml.org/t/eio-streams-clean-termination/14811 "2024-06-19T10:14:37Z")

</div>

Imagine a system with a producer reading an indeterminate batch of jobs, which are processed by workers before being consumed. Each job might generate 0…n results and we don’t particularly care about order. At the end …

---

## [Interaction of effect-based fibers with caml\_release\_runtime\_system?](https://discuss.ocaml.org/t/interaction-of-effect-based-fibers-with-caml-release-runtime-system/14807)

<div class="topic-metadata">

**Author:** [@yawaramin](https://discuss.ocaml.org/u/yawaramin)\
**Replies:** 2\
**Last updated:** [June 18, 2024, 10:40am UTC](https://discuss.ocaml.org/t/interaction-of-effect-based-fibers-with-caml-release-runtime-system/14807 "2024-06-18T10:40:35Z")

</div>

I have been investigating how C library wrappers can achieve non-blocking I/O in OCaml. Here’s an example of such a wrapper (stub): postgresql-ocaml/src/postgresql\_stubs.c at c14d830d3eacd36c18ecf8d2bb93d3b92e092539 · mm…

---

## [\[VIDEO\] Verifying an Effect-Based Cooperative Concurrency Scheduler in Iris, by Adrian Dapprich](https://discuss.ocaml.org/t/video-verifying-an-effect-based-cooperative-concurrency-scheduler-in-iris-by-adrian-dapprich/13825)

<div class="topic-metadata">

**Author:** [@Vincent\_Balat](https://discuss.ocaml.org/u/Vincent_Balat)\
**Replies:** 0\
**Last updated:** [January 9, 2024, 4:34pm UTC](https://discuss.ocaml.org/t/video-verifying-an-effect-based-cooperative-concurrency-scheduler-in-iris-by-adrian-dapprich/13825 "2024-01-09T16:34:47Z")

</div>

Adrian Dapprich gave a talk at Tarides a few weeks ago, about Verifying an Effect-Based Cooperative Concurrency Scheduler in Iris. Here is a link to the video. Abstract: Lightweight asynchronous programming (using fut…

---

## [How to interrupt something that works too long in OCaml 5.x](https://discuss.ocaml.org/t/how-to-interrupt-something-that-works-too-long-in-ocaml-5-x/13804)

<div class="topic-metadata">

**Author:** [@Kakadu](https://discuss.ocaml.org/u/Kakadu)\
**Replies:** 1\
**Last updated:** [January 7, 2024, 10:42am UTC](https://discuss.ocaml.org/t/how-to-interrupt-something-that-works-too-long-in-ocaml-5-x/13804 "2024-01-07T10:42:01Z")

</div>

I want to run arbitrary code and kill it if it works longer than N seconds. Arbitrary means there is not any yield or sleep in the code to pass control to the scheduler. The question was asked before on SO: Interrupt a …

---

## [Update on Eio (effects-based direct-style IO for OCaml 5)](https://discuss.ocaml.org/t/update-on-eio-effects-based-direct-style-io-for-ocaml-5/10395)

<div class="topic-metadata">

**Author:** [@talex5](https://discuss.ocaml.org/u/talex5)\
**Replies:** 2\
**Last updated:** [June 5, 2023, 3:49pm UTC](https://discuss.ocaml.org/t/update-on-eio-effects-based-direct-style-io-for-ocaml-5/10395 "2023-06-05T15:49:47Z")

</div>

Eio provides an effects-based direct-style IO stack for OCaml 5.0. It aims to be easy to use, secure, well documented, and fast. It consists of a generic cross-platform API, plus optimised backends for different platform…

---

## [\[Q\] Does \`Thread\` module really work?](https://discuss.ocaml.org/t/q-does-thread-module-really-work/11718)

<div class="topic-metadata">

**Author:** [@anzhi0708](https://discuss.ocaml.org/u/anzhi0708)\
**Replies:** 9\
**Last updated:** [March 20, 2023, 10:41am UTC](https://discuss.ocaml.org/t/q-does-thread-module-really-work/11718 "2023-03-20T10:41:49Z")

</div>

Hello guys. I’m both a beginner in OCaml & CS, aka a noob. I wrote this piece of code to test Thread module let () = print\_endline "Hello, World!" let rec fib\_normal (n: int): int = match n with | 0 | 1 -\> n …

---

## [Introduction to Eio (video)](https://discuss.ocaml.org/t/introduction-to-eio-video/11571)

<div class="topic-metadata">

**Author:** [@talex5](https://discuss.ocaml.org/u/talex5)\
**Replies:** 0\
**Last updated:** [March 3, 2023, 10:20am UTC](https://discuss.ocaml.org/t/introduction-to-eio-video/11571 "2023-03-03T10:20:53Z")

</div>

I gave an introduction to Eio talk at Tarides last week, and afterwards we thought it might be worth sharing it more widely. I covered more about how Eio compares with Lwt than the README does, and the video includes a s…

---

## [Extreme data race](https://discuss.ocaml.org/t/extreme-data-race/11316)

<div class="topic-metadata">

**Author:** [@sanette](https://discuss.ocaml.org/u/sanette)\
**Replies:** 7\
**Last updated:** [February 6, 2023, 7:54pm UTC](https://discuss.ocaml.org/t/extreme-data-race/11316 "2023-02-06T19:54:09Z")

</div>

Hi, out of curiosity I wanted to see the effect of extreme data race in ocaml 5.0.0, and indeed it is quite extreme. In this test, one domain increases a global variable 100000 times, one domain decreases it 100000 times…

---

## [Affect and Eio fibers together in a single application](https://discuss.ocaml.org/t/affect-and-eio-fibers-together-in-a-single-application/10036)

<div class="topic-metadata">

**Author:** [@Deepali](https://discuss.ocaml.org/u/Deepali)\
**Replies:** 1\
**Last updated:** [June 29, 2022, 9:10am UTC](https://discuss.ocaml.org/t/affect-and-eio-fibers-together-in-a-single-application/10036 "2022-06-29T09:10:51Z")

</div>

I was experimenting few things with Eio Fibers and Affect Fibers. let main () = let comp () = Eio\_linux.run ( fun \_env -\> ignore (Fiber.run (fun () -\> Eio.Std.Switch.run @@ fun sw -\> ( Eio.F…

---

## [Eio 0.1 - effects-based direct-style IO for OCaml 5](https://discuss.ocaml.org/t/eio-0-1-effects-based-direct-style-io-for-ocaml-5/9298)

<div class="topic-metadata">

**Author:** [@talex5](https://discuss.ocaml.org/u/talex5)\
**Replies:** 95\
**Last updated:** [February 23, 2022, 7:33pm UTC](https://discuss.ocaml.org/t/eio-0-1-effects-based-direct-style-io-for-ocaml-5/9298 "2022-02-23T19:33:05Z")

</div>

Eio provides an effects-based direct-style IO stack for OCaml 5.0. It aims to be easy to use, secure, well documented, and fast. It consists of a generic cross-platform API, plus optimised backends for different platform…

---

## [\[mystery solved\] Compiling with continuations: flambda and performance](https://discuss.ocaml.org/t/mystery-solved-compiling-with-continuations-flambda-and-performance/6621)

<div class="topic-metadata">

**Author:** [@Chet\_Murthy](https://discuss.ocaml.org/u/Chet_Murthy)\
**Replies:** 7\
**Last updated:** [October 16, 2020, 10:22pm UTC](https://discuss.ocaml.org/t/mystery-solved-compiling-with-continuations-flambda-and-performance/6621 "2020-10-16T22:22:02Z")

</div>

Aha. Needed a little more care with the placing of abstractions for continuations. Erasing post, b/c now it all works as desired. Restoring the deleted post: I was recently chewing over monadic concurrency, and got …
