Skip to content

gh-110481: Implement inter-thread queue for biased reference counting#114824

Merged
colesbury merged 11 commits intopython:mainfrom
colesbury:gh-110481-inter-thread-queue
Feb 9, 2024
Merged

gh-110481: Implement inter-thread queue for biased reference counting#114824
colesbury merged 11 commits intopython:mainfrom
colesbury:gh-110481-inter-thread-queue

Conversation

@colesbury
Copy link
Copy Markdown
Contributor

@colesbury colesbury commented Jan 31, 2024

Biased reference counting maintains two refcount fields in each object: ob_ref_local and ob_ref_shared. The true refcount is the sum of these two fields. In some cases, when refcounting operations are split across threads,
the ob_ref_shared field can be negative (although the total refcount must be at least zero). In this case, the thread that decremented the refcount requests that the owning thread give up ownership and merge the refcount fields.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants