How to check Rails app's thread safety for Puma How to check Rails app's thread safety for Puma multithreading multithreading

How to check Rails app's thread safety for Puma


Thread safety can not be detected in general. If there was some way to detect it automatically, probably your compiler/interpreter would warn you about it.Race conditions can not be detected by automatic systems, they can be even hard to reproduce.

Depending on your interpreter:

  • CRuby has GIL, so using Puma with it is pointless.
  • If you are using JRuby or Rubinius than you can probably benefit from Puma and most probably the gems you use have documented their methods/classes thread-safety. In this case all you need is to check your code.