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

gh-114203: Optimise simple recursive critical sections #128126

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Yhg1s
Copy link
Member

@Yhg1s Yhg1s commented Dec 20, 2024

Add a fast path to (single-mutex) critical section locking iff the mutex is already held by the top-most critical section of this thread. This can matter a lot for indirectly recursive critical sections without intervening critical sections.

…mutex

is already held by the currently active, top-most critical section of this
thread. This can matter a lot for indirectly recursive critical sections
without intervening critical sections.
should be relatively rare and we don't want to burden the fastest path.
@Yhg1s Yhg1s marked this pull request as ready for review December 20, 2024 23:03
Copy link
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

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

I do wonder if there might be additional optimization opportunities along these lines, but that should be future work if ever needed.

Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants