prelude: don't set Lwt_engine to poll if libev is available#52
Merged
Conversation
Contributor
|
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 |
Contributor
Author
I didn't find a way to do this, engine is object with no way to identify afaics Instead I made it check for libev availability, and use poll if not available |
rr0gi
approved these changes
Nov 24, 2025
| *) | ||
| let () = | ||
| Lwt_engine.set @@ new Lwt_engines.poll | ||
| if not (Lwt_config._HAVE_LIBEV && Lwt_config.libev_default) then begin |
Contributor
|
started making it possible to identify current engine, see ocsigen/lwt#1097 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.