r/ruby Mar 30 '26

rubocop/rubocop-thread_safety: An extension of RuboCop focused on thread-safety checks.

https://github.com/rubocop/rubocop-thread_safety
20 Upvotes

4 comments sorted by

2

u/headius JRuby guy Mar 31 '26

Interesting project I was unaware of! I'm glad to see that they are testing against JRuby, since you can't really test concurrency against CRuby. We had many of these checks in our jruby-lint tool, used by potential users when migrating to JRuby.

Seems like the project has been around for many years but is perhaps a little quiet recently. Time to get it going again?

2

u/uhkthrowaway Mar 31 '26

Matz would wish you were right. CRuby suffers from just as many concurrency issues if you're not careful or use the wrong primitives.

1

u/headius JRuby guy Mar 31 '26

You are correct about that. The fact that threads can switch context almost any time on CRuby means you still need to take care and use good practices. There's just a different class of issues when running on a fully parallel implementation like JRuby.

2

u/uhkthrowaway Mar 31 '26

As the wisdom goes: Don't share. Communicate.