-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Implement internal API for running current event loop #3641
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b3c46ec
Implement internal API for running current event loop
qwwdfsad eb53d94
Update kotlinx-coroutines-core/jvm/src/EventLoop.kt
qwwdfsad 204d539
Apply suggestions from code review
qwwdfsad bfc68da
Update kotlinx-coroutines-core/jvm/src/EventLoop.kt
qwwdfsad 60e570d
Update kotlinx-coroutines-core/common/src/internal/LimitedDispatcher.kt
qwwdfsad e7571d0
Update kotlinx-coroutines-core/jvm/src/scheduling/WorkQueue.kt
qwwdfsad cc9cd1e
~simplify code, apply suggestions etc.
qwwdfsad e44bdbf
~
qwwdfsad a26029c
~
qwwdfsad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still a mystery to me why we don't do it on every iteration any longer. Could you drop a comment in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was to check it once and then look for the task. The only scenario where the task is not found is when another thread decides to steal a blocking task from the very same queue, which is not very likely. Effectively, I traded a negligible part of "slow path" ("unlikely event happened") performance for the same negligible benefit on "fast path".
It's unlikely to matter in reality, so readability/maintainability must be preferred; I'll rollback the change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular place still has the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I would be okay with it if it had a corresponding comment and, preferably, was in a separate commit (this one is a bit loaded with changes already).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I probably have to stop pushing any changes around Friday's evenings 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you could embrace the flow, go for it, and publish a release today.