Skip to content

Conversation

@yasunariw
Copy link
Contributor

Setting the lwt engine to poll at the top level here causes unexpected behavior when the library is used. On Linux, it overrides the default engine, which is libev.

@yasunariw yasunariw requested a review from rr0gi November 11, 2025 09:53
@rr0gi
Copy link
Contributor

rr0gi commented Nov 13, 2025

libev is default if it is available (both opam package and c library during lwt build), otherwise default is select which is worse than poll (limit on 1024 fd) and poll is guaranteed to be available. So ideally the fix should be - check if engine is select and if so - switch to poll, otherwise do nothing

@yasunariw
Copy link
Contributor Author

check if engine is select

I didn't find a way to do this, engine is object with no way to identify afaics
https://github.com/ocsigen/lwt/blob/master/src/unix/lwt_engine.mli

Instead I made it check for libev availability, and use poll if not available

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

Successfully merging this pull request may close these issues.

3 participants