-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Lock region allocator #49990
Lock region allocator #49990
Conversation
…ion_allocator::allocate and region_allocator::delete_region.
Tagging subscribers to this area: @dotnet/gc Issue DetailsMake region_allocator multi-thread safe by wrapping a dedicated lock around region_allocator::allocate and region_allocator:delete_region. Added a few ASSERT_HOLDING_SPIN_LOCK to guard against future bitrot.
|
is there any reason we would use enter_spin_lock for this? enter_spin_lock's main advantage is it's aware of a GC happening and can correctly wait till the GC is done if it needs to. do you anticipate this would need to wait for the GC? this is already running in the code path where we'd want to finish up ASAP so if a GC needs to start it wouldn't need to wait for us for long. |
…eral mechanism that interacts with GC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be fine for our current state; we may want to put in some SwitchToThread later when we are running in more stressful situations.
Make region_allocator multi-thread safe by wrapping a dedicated lock around region_allocator::allocate and region_allocator:delete_region. Added a few ASSERT_HOLDING_SPIN_LOCK to guard against future bitrot.