Skip to content

Re-use initialized ring queues, instead of leaking#18

Open
KvGeijer wants to merge 1 commit intochaoran:masterfrom
KvGeijer:reuse-ring-queue
Open

Re-use initialized ring queues, instead of leaking#18
KvGeijer wants to merge 1 commit intochaoran:masterfrom
KvGeijer:reuse-ring-queue

Conversation

@KvGeijer
Copy link
Copy Markdown

In the LCRQ, when another thread manages to enqueue a new ring queue with CAS before you manage, you have already initialized your RQ. Now the local one is just discarded, which leaks memory.

There is infrastructure in place in the handle to save these initialized ring queues, and later re-use them in future enqueues. This commit fixes that optimization, which seems to have been broken sometime in the past.

In the LCRQ, when another thread manages to enqueue a new ring queue
with CAS before you manage, you have already initialized your RQ. Now
the local one is just discarded, which leaks memory.

There is infrastructure in place in the handle to save these initialized
ring queues, and later re-use them in future enqueues. This commit fixes
that optimization, which seems to have been broken sometime in the past.
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