You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-15Lines changed: 11 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
# Eio -- Effects-Based Parallel IO for OCaml
4
4
5
-
Eio provides an effects-based direct-style IO stack for OCaml 5.0.
5
+
Eio provides an effects-based direct-style IO stack for OCaml 5.
6
6
For example, you can use Eio to read and write files, make network connections,
7
7
or perform CPU-intensive calculations, running multiple operations at the same time.
8
8
It aims to be easy to use, secure, well documented, and fast.
@@ -17,7 +17,7 @@ Eio replaces existing concurrency libraries such as Lwt
17
17
*[Motivation](#motivation)
18
18
*[Current Status](#current-status)
19
19
*[Structure of the Code](#structure-of-the-code)
20
-
*[Getting OCaml 5.0](#getting-ocaml-50)
20
+
*[Getting OCaml 5.1](#getting-ocaml-51)
21
21
*[Getting Eio](#getting-eio)
22
22
*[Running Eio](#running-eio)
23
23
*[Testing with Mocks](#testing-with-mocks)
@@ -64,10 +64,10 @@ Eio replaces existing concurrency libraries such as Lwt
64
64
## Motivation
65
65
66
66
The `Unix` library provided with OCaml uses blocking IO operations, and is not well suited to concurrent programs such as network services or interactive applications.
67
-
For many years, the solution to this has been libraries such as Lwt and Async, which provide a monadic interface.
67
+
For many years, the solution was to use libraries such as Lwt and Async, which provide a monadic interface.
68
68
These libraries allow writing code as if there were multiple threads of execution, each with their own stack, but the stacks are simulated using the heap.
69
69
70
-
OCaml 5.0 adds support for "effects", removing the need for monadic code here.
70
+
OCaml 5 added support for "effects", removing the need for monadic code here.
71
71
Using effects brings several advantages:
72
72
73
73
1. It's faster, because no heap allocations are needed to simulate a stack.
@@ -77,17 +77,13 @@ Using effects brings several advantages:
77
77
78
78
Additionally, modern operating systems provide high-performance alternatives to the old Unix `select` call.
79
79
For example, Linux's io_uring system has applications write the operations they want to perform to a ring buffer,
80
-
which Linux handles asynchronously.
81
-
82
-
Due to this, many OCaml users will want to rewrite their IO code.
83
-
It would be very beneficial to use this opportunity to standardise a single concurrency API for OCaml,
84
-
and we hope that Eio will be that API.
80
+
which Linux handles asynchronously, and Eio can take advantage of this.
85
81
86
82
## Current Status
87
83
88
84
See [Eio 1.0 progress tracking](https://github.com/ocaml-multicore/eio/issues/388) for the current status.
89
85
Please try porting your programs to use Eio and submit PRs or open issues when you find problems.
90
-
Remember that you can always fall back to using Lwt libraries to provide missing features if necessary.
86
+
Remember that you can always [fall back to using Lwt libraries](#lwt) to provide missing features if necessary.
91
87
92
88
See [Awesome Multicore OCaml][] for links to work migrating other projects to Eio.
93
89
@@ -100,19 +96,19 @@ See [Awesome Multicore OCaml][] for links to work migrating other projects to Ei
100
96
-[Eio_windows][] is for use on Windows (incomplete - [help wanted](https://github.com/ocaml-multicore/eio/issues/125)).
101
97
-[Eio_main][] selects an appropriate backend (e.g. `eio_linux` or `eio_posix`), depending on your platform.
102
98
103
-
## Getting OCaml 5.0
99
+
## Getting OCaml 5.1
104
100
105
-
You'll need OCaml 5.0.0 or later.
101
+
You'll need OCaml 5.1.0 or later.
106
102
You can either install it yourself or build the included [Dockerfile](./Dockerfile).
107
103
108
104
To install it yourself:
109
105
110
106
1. Make sure you have opam 2.1 or later (run `opam --version` to check).
111
107
112
-
2. Use opam to install OCaml 5.0.0:
108
+
2. Use opam to install OCaml:
113
109
114
110
```
115
-
opam switch create 5.0.0
111
+
opam switch create 5.1.1
116
112
```
117
113
118
114
## Getting Eio
@@ -1003,7 +999,7 @@ The mock backend provides a mock clock that advances automatically where there i
1003
999
1004
1000
## Multicore Support
1005
1001
1006
-
Fibers are scheduled cooperatively within a single domain, but you can also create new domains that run in parallel.
1002
+
Fibers are scheduled cooperatively within a single [domain](https://v2.ocaml.org/manual/parallelism.html), but you can also create new domains that run in parallel.
1007
1003
This is useful to perform CPU-intensive operations quickly.
1008
1004
For example, let's say we have a CPU intensive task:
0 commit comments