
Ruby daemons using RobustThread - twampss
http://superjared.com/entry/ruby-daemons-using-robustthread/
======
fizx
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.

~~~
superjared
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.

~~~
fizx
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
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.

