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

Untangle some threads (aka. clean up caching mechanisms with unnecessary thread_mattr_accessor) #9758

Merged
merged 10 commits into from
Oct 16, 2024

Conversation

gregorbg
Copy link
Member

@gregorbg gregorbg commented Aug 9, 2024

Turns out we were a bit more careful than we needed to be when introducing strongly thread-safe attribute caches in #9681

The thread-safe accessors can make it so that all threads hold their own, local copies. But in most cases, we actually don't want the threads to hold their own local copies. For example, we don't want the cached 3x3 event to exist N times for N threads.

Further reading on why the GIL is helpful here: https://thoughtbot.com/blog/untangling-ruby-threads

@gregorbg gregorbg force-pushed the cleanup/tc-caching branch 2 times, most recently from 5c56085 to 23fcc8d Compare September 16, 2024 11:50
Copy link
Member

@FinnIckler FinnIckler left a comment

Choose a reason for hiding this comment

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

LGTM

@gregorbg gregorbg merged commit c81debf into thewca:main Oct 16, 2024
2 checks passed
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.

2 participants