4 ms·
Semi-random deadlocks, lack of thread-safety in many stdlib classes, inability to schedule very many of them. I tried to add some paralellism to my Ruby wget p
by fizx 17y ago
Semi-random deadlocks, lack of thread-safety in many stdlib classes, inability to schedule very many of them. I tried to add some paralellism to my Ruby wget port, and it was a nightmare. There hasn't been the same amount of work put into Ruby threads as Posix or Java, and it shows. Threading is hard.
That said, Ruby threads are fine for simple cases, but EventMachine is popular for a reason.
- catch23 17y agoWhy would there be need for thread safety in ruby? There's a global interpreter lock so there's really only 1 thread running at any time -- every line of your ruby code should be atomic. The more threads you schedule, the more the interpreter has to cycle them in and out, so basically threads are somewhat useless in ruby. The devs had to spend time making Rails thread safe due to JRuby where there isn't a GIL.