Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ruby daemons using RobustThread (superjared.com)
16 points by twampss on June 11, 2009 | hide | past | favorite | 4 comments


This seems useful. If you like stuff like this, you should also look at all the goodies in facets.rubyforge.org.

That said, this library is about programmer convenience, and does nothing about Ruby threads being flaky little bastards. I'm a little disappointed.


Flaky in what way? In my usage of them I haven't had problems. Then again I use them with a lot of blocking io operations so they seem to be pretty fairly scheduled.


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.


Why 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.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: