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

Rework unique context management. #2202

Merged
merged 2 commits into from
Dec 12, 2023
Merged

Rework unique context management. #2202

merged 2 commits into from
Dec 12, 2023

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Dec 12, 2023

This PR switches from a reentrant lock + dict for unique context creation (which is needed for tracking resources so that we can safely free them) to a simple linear scan of an array and a spinlock. Hopefully it fixes #2171.

@maleadt maleadt changed the title Create unique contexts without a lock. Rework unique context management. Dec 12, 2023
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (6873997) 72.93% compared to head (f89e45a) 72.90%.
Report is 1 commits behind head on master.

Files Patch % Lines
lib/cudadrv/context.jl 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2202      +/-   ##
==========================================
- Coverage   72.93%   72.90%   -0.04%     
==========================================
  Files         159      159              
  Lines       14651    14662      +11     
==========================================
+ Hits        10686    10689       +3     
- Misses       3965     3973       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maleadt maleadt merged commit 47168b7 into master Dec 12, 2023
1 check passed
@maleadt maleadt deleted the tb/unique_contexts branch December 12, 2023 19:46
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.

Modifying struct containing CuArray fails in threads in 5.0.0 and 5.1.0
1 participant