Skip to content

Conversation

@stIncMale
Copy link
Member

@stIncMale stIncMale commented Apr 29, 2021

TODO: rebase on top of master after merging #699, then request for review.

JAVA-3927

@stIncMale stIncMale force-pushed the JAVA-3927_simplify branch from fed5c85 to 5971c21 Compare April 29, 2021 20:49
@stIncMale stIncMale requested review from jyemin and rozza April 29, 2021 20:53
@stIncMale stIncMale force-pushed the JAVA-3927_simplify branch from 5971c21 to cca5b0e Compare April 29, 2021 22:34
@stIncMale stIncMale removed request for jyemin and rozza April 29, 2021 22:45
Copy link
Collaborator

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

Can you provide some context as to the purpose of this change? It seems like a behavioral change, but the PR title seems to indicate that it's not.

@stIncMale stIncMale force-pushed the JAVA-3927_simplify branch from cca5b0e to 09b3f3f Compare April 29, 2021 23:39
@stIncMale
Copy link
Member Author

Can you provide some context as to the purpose of this change? It seems like a behavioral change, but the PR title seems to indicate that it's not.

@jyemin Now that you know there is a commit message, is this request still actual?

Copy link
Collaborator

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

LGTM!

When locking for the purpose of using the wait/signal approach,
one does not have to account the time spent acquiring the lock
towards the timeout. While doing so may reduce the
non-deterministic duration by which a timeout is exceeded
by any implementation of a timeout, such overtime is usually negligible,
unless the lock is highly contended and/or checking the condition
before starting to wait is time-consuming.

The Java SE example for `java.util.concurrent.locks.Condition.awaitNanos`
ignores the time spent acquiring the lock. Doing so potentially reduces
responsiveness to timeouts, but does not
affect other performance characteristics, so I believe such simplification
is worth it and I should have taken this path initially.

JAVA-3927
@stIncMale stIncMale force-pushed the JAVA-3927_simplify branch from d1d9ad4 to 3bce9e7 Compare May 1, 2021 22:48
@stIncMale stIncMale merged commit ddefdb0 into mongodb:master May 2, 2021
@stIncMale stIncMale deleted the JAVA-3927_simplify branch May 2, 2021 00:18
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.

2 participants