···1313* [Motivation](#motivation)
1414* [Current Status](#current-status)
1515* [Structure of the Code](#structure-of-the-code)
1616-* [Getting Started](#getting-started)
1616+* [Getting OCaml 5.0](#getting-ocaml-50)
1717+* [Getting Eio](#getting-eio)
1818+* [Running Eio](#running-eio)
1719* [Testing with Mocks](#testing-with-mocks)
1820* [Fibers](#fibers)
1921* [Tracing](#tracing)
···66686769## Current Status
68706969-Eio can be used with OCaml 5.0.0+trunk or with 4.12.0+domains.
7070-7171Eio is able to run a web-server with [good performance][http-bench],
7272but you are likely to encounter missing features while using it.
7373If you'd like to help out, please try porting your program to use Eio and submit PRs or open issues when you find problems.
···9999 plus a low-level API that can be used directly (in non-portable code).
100100- [Eio_main][] selects an appropriate backend (e.g. `eio_linux` or `eio_luv`), depending on your platform.
101101102102-## Getting Started
102102+## Getting OCaml 5.0
103103104104-You'll need a version of the OCaml compiler with effects.
105105-`5.0.0+trunk` often works but is a moving target, so we suggest using `4.12.0+domains` for now
106106-(however, this only supports x86_64 systems).
107107-You can get it like this:
104104+You'll need OCaml 5.0.0~alpha0 or later.
105105+You can either install it yourself or build the included [Dockerfile](./Dockerfile).
108106109109-```
110110-opam switch create 4.12.0+domains --repositories=multicore=git+https://github.com/ocaml-multicore/multicore-opam.git,default
111111-```
107107+To install it yourself:
112108113113-To use 5.0.0~alpha0 (which is needed on ARM), use this command instead:
109109+1. Make sure you have opam 2.1 or later (run `opam --version` to check).
110110+111111+2. Use opam to install OCaml 5.0.0~alpha0 or later:
114112115115-```
116116-opam switch create 5.0.0~alpha0 --repo=default,alpha=git+https://github.com/kit-ty-kate/opam-alpha-repository.git
117117-```
113113+ ```
114114+ opam switch create 5.0.0~alpha0 --repo=default,alpha=git+https://github.com/kit-ty-kate/opam-alpha-repository.git
115115+ ```
116116+117117+## Getting Eio
118118119119If you want to run the latest development version from Git, run these commands
120120(otherwise, skip them and you'll get the latest release from opam):
···125125opam pin -yn .
126126```
127127128128-Finally, install this library (and `utop` if you want to try it interactively):
128128+Either way, install `eio_main` (and `utop` if you want to try it interactively):
129129130130```
131131-opam depext -i eio_main utop # (for opam 2.0)
132132-opam install eio_main utop # (for opam 2.1)
131131+opam install eio_main utop
133132```
134134-(Run `opam --version` if you're not sure which one you have installed.)
133133+134134+## Running Eio
135135136136Try out the examples interactively by running `utop` in the shell.
137137
···1818 | Trace : (?__POS__:(string * int * int * int) -> ('a, Format.formatter, unit, unit) format4 -> 'a) Effect.t
1919 end
20202121- module Effect = Effect
2222-2321 let traceln_mutex = Mutex.create ()
24222523 let default_traceln ?__POS__:pos fmt =
-3
lib_eio/core/eio__core.mli
···455455 (** [get_error t] is [Cancel.get_error (cancellation_context t)] *)
456456 end
457457458458- (** Temporary hack for compatibility with ocaml.4.12+domains *)
459459- module Effect = Effect
460460-461458 module Effects : sig
462459 type 'a enqueue = ('a, exn) result -> unit
463460 (** A function provided by the scheduler to reschedule a previously-suspended thread. *)
-1
lib_eio/mock/backend.ml
···11module Fiber_context = Eio.Private.Fiber_context
22-module Effect = Eio.Private.Effect (* For compatibility with 4.12+domains *)
32module Lf_queue = Eio_utils.Lf_queue
4354exception Deadlock_detected