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

Replace Unix.select with Unix.sleepf #3957

Merged
merged 2 commits into from
Nov 23, 2020

Conversation

rgrinberg
Copy link
Member

select had no arguments, so it's the same as a sleep.

@rgrinberg rgrinberg requested review from aalekseyev and nojb November 19, 2020 20:09
@nojb
Copy link
Collaborator

nojb commented Nov 20, 2020

Looks OK, but I will play with it today just in case.

Copy link
Collaborator

@nojb nojb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I tested a full rebuild of our codebase under Windows before and after the PR, to make sure there weren't any big timing regressions.

@rgrinberg
Copy link
Member Author

I tested a full rebuild of our codebase under Windows before and after the PR, to make sure there weren't any big timing regressions.

Let's see if @dra27 approves to be extra safe.

@rgrinberg rgrinberg requested a review from dra27 November 23, 2020 18:09
@dra27
Copy link
Member

dra27 commented Nov 23, 2020

Why not just use Unix.sleepf? I expect that at the time it was written we still supported 4.02.3 for building?

@rgrinberg
Copy link
Member Author

Why not just use Unix.sleepf

Mostly because we use Thread.delay elsewhere in this module. Isn't it the same though?

@dra27
Copy link
Member

dra27 commented Nov 23, 2020

Indeed - Thread.delay is an alias for Unix.sleepf - I sort of prefer sleep (which implies spinning) to delay (which implies timing) 🙂

Incidentally, it used to be Unix.sleepf, I had remembered correctly that it was changed for 4.02.3 compat: 27a2994#diff-2ab64c3235ac84078222643eddc2bb55bd20b98688ecc9c807dadb4bba96a6f7

select had no arguments, so it's the same as a sleep.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
@rgrinberg rgrinberg force-pushed the replace-select-sleep branch from 79c0053 to 3cc3724 Compare November 23, 2020 20:03
@rgrinberg rgrinberg merged commit 92e1c27 into ocaml:master Nov 23, 2020
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