Is Ruby's stdlib Logger class thread-safe?

后端 未结 4 721
长情又很酷
长情又很酷 2021-01-03 18:31

In short, is the standard library Logger class in Ruby thread-safe? Only useful info Google turned up was someone on a forum saying it \"seems\" thread-safe. And I don\'t fe

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-03 18:57

    Below is my original response, which is actually wrong. Read Nemo157's comment below. I left it here for reference only.

    Original:

    I don't think it matters. All implementations of Ruby that I know of so far effectively run one thread at a time anyway: It does allow you to start many threads, but only one thread runs at a time per process.

提交回复
热议问题