-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The manual and API docs are still using "thread," this will be changed in the new manual (coming "soon"). Related #300. [skip ci]
- Loading branch information
Showing
3 changed files
with
53 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
Cooperative threads and I/O in monadic style | ||
Monadic promises and concurrent I/O | ||
|
||
Lwt provides typed, composable cooperative threads. These make it easy to run | ||
normally-blocking I/O operations concurrently in a single process. Also, in many | ||
cases, Lwt threads can interact without the need for locks or other | ||
synchronization primitives. | ||
A promise is a value that may become determined in the future. | ||
|
||
Lwt provides typed, composable promises. Promises that are resolved by I/O are | ||
resolved by Lwt in parallel. | ||
|
||
Meanwhile, OCaml code, including code creating and waiting on promises, runs in | ||
a single thread by default. This reduces the need for locks or other | ||
synchronization primitives. Code can be run in parallel on an opt-in basis. |