Skip to content
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

Tell libev to use kqueue by default on macOS #601

Open
aantron opened this issue Jun 27, 2018 · 5 comments
Open

Tell libev to use kqueue by default on macOS #601

aantron opened this issue Jun 27, 2018 · 5 comments

Comments

@aantron
Copy link
Collaborator

aantron commented Jun 27, 2018

On macOS, libev seems to default, too often, to select(2). Given that a major reason for using libev in the first place is to avoid select(2), we should have Lwt ask libev for its kqueue backend explicitly.

In other words, on macOS, new Lwt_engine.libev () should default to new Lwt_engine.(libev ~backend:Ev_backend.kqueue ()). See class Lwt_engine.libev.

cc @yallop, @anmonteiro as people who have been bitten by this.

@aantron
Copy link
Collaborator Author

aantron commented Jun 27, 2018

See also #269, in which @yallop added support for choosing the backend.

@aantron aantron added this to the 4.2.2 milestone Apr 3, 2019
@aantron aantron modified the milestones: 4.2.2, libuv Jul 26, 2019
@aantron
Copy link
Collaborator Author

aantron commented Mar 31, 2020

libev should probably also be chosen by default on mac:

match Configurator.ocaml_config_var_exn context "system" with
| "linux"
| "linux_elf"
| "linux_aout"
| "linux_eabi"
| "linux_eabihf" ->
true
| _ ->
false

@aantron aantron modified the milestones: libuv, 5.2.1 Mar 31, 2020
@aantron
Copy link
Collaborator Author

aantron commented Apr 1, 2020

This also seems to be a duplicate of #87.

aantron added a commit that referenced this issue Apr 1, 2020
@aantron aantron removed this from the 5.2.1 milestone May 7, 2020
@Marchhill
Copy link

I am currently having problems with this. When I run:
Lwt_engine.set (new Lwt_engine.libev ~backend:Lwt_engine.Ev_backend.kqueue ());
I get a segmentation fault. Are there any workarounds for this?
Platform: macOS 12.5

@raphael-proust
Copy link
Collaborator

@Marchhill what Lwt version are you using? Can you reproduce on the HEAD of the master branch?
What ocaml version are you using?

I don't have a mac so I can't reproduce, but having the added info could help someone else check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants