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

Add Base.@acquire for non-closure version of Base.acquire(f, s::Base.Semaphore) #56845

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

IanButterworth
Copy link
Member

Given @lock exists, this would make sense.

@nsajko nsajko added multithreading Base.Threads and related functionality feature Indicates new feature / enhancement requests labels Dec 16, 2024
@nsajko
Copy link
Contributor

nsajko commented Dec 16, 2024

Is this purely intended as a workaround for #15276 in the context of usage of acquire?

If so, IMO it's redundant with the more general workaround of adding a let around the closure definition, as described in the Performance Tips.

@IanButterworth
Copy link
Member Author

@nsajko I think you'll see from your work that there is a benefit to avoiding closures where possible.

@IanButterworth IanButterworth added the merge me PR is reviewed. Merge when all tests are passing label Mar 31, 2025
@IanButterworth IanButterworth changed the title add Base.@acquire for non-closure version of Base.acquire(f, s::Base.Semaphore) Add Base.@acquire for non-closure version of Base.acquire(f, s::Base.Semaphore) Apr 1, 2025
@IanButterworth IanButterworth merged commit 2fd6db2 into JuliaLang:master Apr 2, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Indicates new feature / enhancement requests merge me PR is reviewed. Merge when all tests are passing multithreading Base.Threads and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants