ocaml-multicore / eio

Effects-based direct-style IO for multicore OCaml
Other
548 stars 66 forks source link

Implement simple atomic stream select #585

Open dermesser opened 1 year ago

dermesser commented 1 year ago

for #577, to supersede #578.

I want to emphasize that this change is based on my likely too superficial understanding of the library. It is likely that there exists a more elegant way to implement it.

Again, I'm not at all offended if a tighter implementation ends up replacing this PR, but my fingers were itching to try and implement it myself :-)

dermesser commented 1 year ago

I'm currently also trying to understand the 0-capacity stream mechanics, and hopefully will come up with a way to (ideally) select out of a mixed set of streams.

dermesser commented 1 year ago

I've added a small benchmark (f733045) which helped fix two bugs (the two preceding commits).