------art_40593_8975296.1147116742553
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I'm glad you asked. Eventmachine is single-threaded. That's an essential
part of its design. (More for performance and scalability than to remove any
need for synchronization, which is very difficult between native threads and
Ruby threads. (Well, it's actually impossible. Eventmachine does it through
a mechanism that is unrelated to threads.) There's an EventMachine wiki that
has a page on the "Reactor model" which explains this in more detail.
http://eventmachine.rubyforge.org/wiki/wiki.pl

However, if you want to implement a thread-pool in Ruby threads to handle
your workload, that's perfectly compatible with Eventmachine, and your
threads will run concurrently with Eventmachine. This might make sense if
the processing you have to do on behalf of your clients involves something
like writing to a database, where there is a system latency that you can't
hand off to Eventmachine (because DBMS client libraries are usually not
asynchronous).


On 5/8/06, James Edward Gray II <james / grayproductions.net> wrote:
>
> On May 8, 2006, at 2:09 PM, Francis Cianfrocca wrote:
>
> > If you download the eventmachine gem and install the rdocs, the API
> > docs
> > will all be there, and there is sample code too.
>
> Forgive me if this is answered in the documentation, I have had time
> to look:  Is EventMachine multi-threaded?  I'm mainly wondering if I
> need to synchronize the methods that socket data arriving.
>
> James Edward Gray II
>
>

------art_40593_8975296.1147116742553--