2012/5/22 GT <
georgeo.d...@gmail.com>:
> but operations
> done in defer need synchronization ( as they execute in one of the
> threads from the threadpool ). Is this right?
Sure, the question is: why do you need threads? Ruby MRI can only use
a single native thread due to the GLI (GVL) so you won't get better
performance.
If you won't execute blocking code (this is, code that waits for I/O)
then use... EventMachine! :)
If you need to do blocking operations (this is, using Ruby libraries
that block for I/O but *release* the GIL/GVL) then use threads within
EM but, as you said, you must control those threads.
--
Iñaki Baz Castillo
<
i...@aliax.net>