-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Rewrite the implementation of the linked list for JobSupport
#4095
base: develop
Are you sure you want to change the base?
Conversation
176b417
to
9b9148c
Compare
@qwwdfsad, could you help with optimizing the memory consumption? Not requesting a proper review yet because I know already the code is messy, I just expect it to get even messier during memory consumption optimization. |
4858fc5
to
494d8ca
Compare
03a42b9
to
7fe8543
Compare
With this change, `JobSupport` uses only a small and well-defined portion of the functionality `LockFreeLinkedList` provides, which makes it easier to replace the list implementation.
In exchange, now, removal is linear in the size of number of registered handlers instead of being amortized constant.
7fe8543
to
70c9926
Compare
For some reason, tests hang after a rebase, exclusively on Wasm/JS. |
After some discussions with kotlinx.coroutines/kotlinx-coroutines-core/common/src/internal/LockFreeLinkedList.common.kt Line 157 in 70c9926
BrokenForSomeElements a non-value class, but we're currently negotiating about having value classes work with CAS consistently.
This shouldn't block further work on this PR, we can work around this at the last moment if needed. |
It's not just value classes; apparently, all types that can be boxed aren't guaranteed to do something sensible with |
6fa8981
to
a025add
Compare
Fixes #3886
One of the steps for #3887
A draft because
JobSupport
.