简体   繁体   中英

Question about thread-safety and disabling multi-threading with Puma

The Puma readme states the following: "Be aware that additionally Puma creates threads on its own for internal purposes (eg handling slow clients). So, even if you specify -t 1:1, expect around 7 threads created in your application."

Suppose that my Rails app is not thread-safe, and as such I need to prevent the app from being multi-threaded. Let's say I use Puma and specify -t 1:1 to try configure this. Is there any thread-safety-related reason for me to be concerned that Puma will still create threads on its own for internal purposes? I think the answer is probably no, but I'm asking here to be sure.

I asked this same question in a GitHub issue as well.

The GitHub issue received the following answer and was marked as completed:

No, these threads don't interact with your app in any way, and only one thread will ever run your application code, ever, with no concurrency.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM