-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Eio.Pool.use ~never_block #657
Conversation
fcda90c
to
a65ab7b
Compare
c1e0aa1
to
c91cf5c
Compare
5b4abc9
to
dbb74d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks useful - thanks!
(I rebased and also updated the test to check that dispose works for the temporary resource)
lib_eio/pool.ml
Outdated
| false when never_block -> | ||
(* We are at capacity, but cannot block. | ||
Create a new resource to run f but don't add it to the pool. *) | ||
Atomic.set cell Finished; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't quite right. The cell might contain a Resource
by now. If so, we should use that.
(probably needs an Atomic.exchange cell Finished
here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll fix it this weekend if you don't get to it first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed. I have a remaining question for you that I'm keeping for the devs meeting, so I think merging this PR should wait until after the meeting.
dbb74d3
to
029e15a
Compare
029e15a
to
321bc09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
CHANGES: New features: - Add `Eio.Path.symlink` (@patricoferris ocaml-multicore/eio#715, reviewed by @talex5). - Add `Eio.Pool.use ~never_block` (@SGrondin ocaml-multicore/eio#657, reviewed by @talex5). - Add `Eio_unix.Net.import_socket_listening` (@alyssais ocaml-multicore/eio#733). - Add `Eio.Time.Timeout.sleep` (@talex5 ocaml-multicore/eio#726). Documentation: - Add `examples/fs` showing how to walk a directory tree (@talex5 ocaml-multicore/eio#730). - README: explain that `read_all` reads until shutdown (@talex5 ocaml-multicore/eio#717, reported by @Wenke-D). - Use long dash in README title (@lucperkins ocaml-multicore/eio#718). Linux backend: - Require Linux >= 5.15 (@talex5 ocaml-multicore/eio#720, reviewed by @SGrondin and @avsm). Removes a work-around that required checking whether every flow was a tty. - Don't call submit immediately before wait (@talex5 ocaml-multicore/eio#728). This is slightly faster and makes the traces clearer. - Don't record submit events when there's nothing to submit (@talex5 ocaml-multicore/eio#729). Makes the traces a bit clearer. - Split flow into its own file (@talex5 ocaml-multicore/eio#727). - Add work-around for signals race (@talex5 ocaml-multicore/eio#734). POSIX backend: - Add `_BSD_SOURCE` flag to fix build on OpenBSD (@prgbln ocaml-multicore/eio#722). - Fix sandboxed path resolution on OpenBSD (@jebrosen ocaml-multicore/eio#723, reviewed by @talex5). OpenBSD uses `ELOOP` when opening a symlink with `O_NOFOLLOW`. Build and test: - Benchmarks: record uname, Eio backend, and number of cores (@talex5 ocaml-multicore/eio#719). - Update to MDX 2.4.1 for OCaml 5.2 (@talex5 ocaml-multicore/eio#712).
CHANGES: New features: - Add `Eio.Path.symlink` (@patricoferris ocaml-multicore/eio#715, reviewed by @talex5). - Add `Eio.Pool.use ~never_block` (@SGrondin ocaml-multicore/eio#657, reviewed by @talex5). - Add `Eio_unix.Net.import_socket_listening` (@alyssais ocaml-multicore/eio#733, reviewed by @talex5). - Add `Eio.Time.Timeout.sleep` (@talex5 ocaml-multicore/eio#726). Documentation: - Add `examples/fs` showing how to walk a directory tree (@talex5 ocaml-multicore/eio#730). - README: explain that `read_all` reads until shutdown (@talex5 ocaml-multicore/eio#717, reported by @Wenke-D). - Use long dash in README title (@lucperkins ocaml-multicore/eio#718). Linux backend: - Require Linux >= 5.15 (@talex5 ocaml-multicore/eio#720, reviewed by @SGrondin and @avsm). Removes a work-around that required checking whether every flow was a tty. - Don't call submit immediately before wait (@talex5 ocaml-multicore/eio#728). This is slightly faster and makes the traces clearer. - Don't record submit events when there's nothing to submit (@talex5 ocaml-multicore/eio#729). Makes the traces a bit clearer. - Split flow into its own file (@talex5 ocaml-multicore/eio#727). - Add work-around for signals race (@talex5 ocaml-multicore/eio#734). POSIX backend: - Add `_BSD_SOURCE` flag to fix build on OpenBSD (@prgbln ocaml-multicore/eio#722). - Fix sandboxed path resolution on OpenBSD (@jebrosen ocaml-multicore/eio#723, reviewed by @talex5). OpenBSD uses `ELOOP` when opening a symlink with `O_NOFOLLOW`. Build and test: - Benchmarks: record uname, Eio backend, and number of cores (@talex5 ocaml-multicore/eio#719). - Update to MDX 2.4.1 for OCaml 5.2 (@talex5 ocaml-multicore/eio#712).
CHANGES: New features: - Add `Eio.Path.symlink` (@patricoferris ocaml-multicore/eio#715, reviewed by @talex5). - Add `Eio.Pool.use ~never_block` (@SGrondin ocaml-multicore/eio#657, reviewed by @talex5). - Add `Eio_unix.Net.import_socket_listening` (@alyssais ocaml-multicore/eio#733, reviewed by @talex5). - Add `Eio.Time.Timeout.sleep` (@talex5 ocaml-multicore/eio#726). Documentation: - Add `examples/fs` showing how to walk a directory tree (@talex5 ocaml-multicore/eio#730). - README: explain that `read_all` reads until shutdown (@talex5 ocaml-multicore/eio#717, reported by @Wenke-D). - Use long dash in README title (@lucperkins ocaml-multicore/eio#718). Linux backend: - Require Linux >= 5.15 (@talex5 ocaml-multicore/eio#720, reviewed by @SGrondin and @avsm). Removes a work-around that required checking whether every flow was a tty. - Don't call submit immediately before wait (@talex5 ocaml-multicore/eio#728). This is slightly faster and makes the traces clearer. - Don't record submit events when there's nothing to submit (@talex5 ocaml-multicore/eio#729). Makes the traces a bit clearer. - Split flow into its own file (@talex5 ocaml-multicore/eio#727). - Add work-around for signals race (@talex5 ocaml-multicore/eio#734). POSIX backend: - Add `_BSD_SOURCE` flag to fix build on OpenBSD (@prgbln ocaml-multicore/eio#722). - Fix sandboxed path resolution on OpenBSD (@jebrosen ocaml-multicore/eio#723, reviewed by @talex5). OpenBSD uses `ELOOP` when opening a symlink with `O_NOFOLLOW`. Build and test: - Benchmarks: record uname, Eio backend, and number of cores (@talex5 ocaml-multicore/eio#719). - Update to MDX 2.4.1 for OCaml 5.2 (@talex5 ocaml-multicore/eio#712).
This PR adds the optional parameter
?never_block:bool
toEio.Pool.use
. The default isfalse
.Quoting
pool.mli
:In my opinion, this feature makes
Eio.Pool
a valid choice for a wider range of use cases.