Skip to content

Conversation

@jhawthorn
Copy link
Member

Currently we use ractor_sched_lock to serialize changes to a Ractor's state when we go to/from waiting for the GVL. This changes that operation to use an atomic for the case that we expect to return as an SNT later.

Comment on lines +714 to +715
unsigned int snt_cnt; // count of shared NTs (including waiting)
rb_atomic_t waiting_snt_cnt; // count of shared NTs in blocking calls
Copy link
Member

Choose a reason for hiding this comment

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

This order may have a padding.

@jhawthorn jhawthorn changed the title Use atomic for temporarily waiting SNTs [4.1] Use atomic for temporarily waiting SNTs Dec 18, 2025
@nobu nobu added the ruby 4.1 label Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants