lwt icon indicating copy to clipboard operation
lwt copied to clipboard

Tell libev to use kqueue by default on macOS

Open aantron opened this issue 6 years ago • 5 comments

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 avatar Jun 27 '18 21:06 aantron

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

aantron avatar Jun 27 '18 21:06 aantron

libev should probably also be chosen by default on mac:

https://github.com/ocsigen/lwt/blob/ee466e23979644beb30f2d51a9835f5ffe34a3ab/src/unix/config/discover.ml#L860-L868

aantron avatar Mar 31 '20 18:03 aantron

This also seems to be a duplicate of #87.

aantron avatar Apr 01 '20 08:04 aantron

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

Marchhill avatar Jan 13 '23 10:01 Marchhill

@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.

raphael-proust avatar Feb 03 '23 07:02 raphael-proust