Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rtic-sync: No need for c-s to check if link is in wait queue if link is popped#1042

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
datdenkikniet merged 3 commits intomasterfromno-need-for-cs-if-popped
Mar 23, 2025

Conversation

datdenkikniet
Copy link
Contributor

@datdenkiknietdatdenkikniet commentedMar 18, 2025
edited
Loading

Minor improvement: if we insert our link into the wait queue, we always take a critical section (in theOnDrop) to ensure that it is no longer in the list on drop.

However, if our link is popped, we know for a fact that it is not in the list.take()-ing it in the block that gets us into that state saves us an unnecessary critical section, which is probably the 2nd-most common scenario (the 1st being finding a free slot immediately).

Additionally, we take a critical-section to check whether we still have an entry in ourSlotPtr. However, once we are certain that ourlink is removed from the list, we have exclusive access to it again: hence, we can skip that critical section too, on the happy path.

@datdenkiknietdatdenkikniet changed the titlertic-sync: No need for cs if wait-queue link is poppedrtic-sync: No need for c-s to check if link is in wait queue if link is poppedMar 18, 2025
@datdenkiknietdatdenkiknietforce-pushed theno-need-for-cs-if-popped branch 3 times, most recently fromd41a189 tof612ba0CompareMarch 19, 2025 20:47
Copy link
Collaborator

@korken89korken89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM! Thank you!

@datdenkikniet
Copy link
ContributorAuthor

datdenkikniet commentedMar 23, 2025
edited
Loading

This will block merging of#1038, so will wait until that is in :)

ETA: I am entirely lying. Will merge this

@datdenkiknietdatdenkikniet added this pull request to themerge queueMar 23, 2025
Merged via the queue intomaster with commitd76252dMar 23, 2025
50 checks passed
@datdenkiknietdatdenkikniet deleted the no-need-for-cs-if-popped branchMarch 23, 2025 10:47
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@korken89korken89korken89 approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@datdenkikniet@korken89

[8]ページ先頭

©2009-2025 Movatter.jp