Create new Chunk which shares the internal storage of the previous Ch…#14393
Closed
normanmaurer wants to merge 1 commit into4.2from
Closed
Create new Chunk which shares the internal storage of the previous Ch…#14393normanmaurer wants to merge 1 commit into4.2from
normanmaurer wants to merge 1 commit into4.2from
Conversation
…unk when queue for reuse Motivation: We need to ensure we never end up with a race / inconsistency related to the reference count when a Chunk is queued to be reused. Previous to this commit we never correctly set the reference count when we could not queue it. Modifications: Create a new Chunk and so ensure we never end up with inconsistent state / races in terms of reference count Result: More correct code
chrisvest
reviewed
Oct 4, 2024
| if (!mag.trySetNextInLine(chunk)) { | ||
| if (!parent.offerToQueue(chunk)) { | ||
| // The central queue is full. Drop the chunk which will also release the delegate. | ||
| chunk.release(); |
Member
There was a problem hiding this comment.
Might this not be recursive and come back to here, but in the chunk we just created?
Member
Author
There was a problem hiding this comment.
Hmm yeah you are right ... maybe let's just do what I had in the other PR before
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…unk when queue for reuse
Motivation:
We need to ensure we never end up with a race / inconsistency related to the reference count when a Chunk is queued to be reused. Previous to this commit we never correctly set the reference count when we could not queue it.
Modifications:
Create a new Chunk and so ensure we never end up with inconsistent state / races in terms of reference count
Result:
More correct code