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

Removal of counters in Kotlin Channels #4302

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

de-shyt
Copy link

@de-shyt de-shyt commented Dec 18, 2024

Previous behaviour

The earlier implementation relied on counters to track the number of pointers referencing each node. When a pointer moved to the next node, the counter on the current node was decremented, and the counter on the next node was incremented. A node was marked as logically removed (and then subject to physical removal) when its counter was equal to 0, indicating no active pointers.

New behaviour

The new implementation does not use counters anymore. When the pointer is moved to the next node, no further action is needed to maintain a consistent state of the list. The removal process does not depend on the position of pointers; instead, after the physical removal happened and if there are any pointers on the removed node, they are moved forward to the first alive node or the tail if such node does not exist.

cleanPrev() invocations

TODO

@ndkoval ndkoval marked this pull request as draft December 18, 2024 13:35
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.

1 participant