question: what if you have other threads running Ruby while EM is running. I assume that EM will buffer input until Ruby gets back to it (is that right?) Do the other threads get run, as in equally as often as the EM thread does? (Does EM just call ruby_go_ahead_and_context_switch every so often or what not?) Does EM buffer in the background while the other threads run, by chance? Thanks for your help! -Roger -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20071017/c2c77c7b/attachment.html
On 10/17/07, Roger Pack <rogerpack2005 at gmail.com> wrote:> > question: > what if you have other threads running Ruby while EM is running. > I assume that EM will buffer input until Ruby gets back to it (is that > right?) > Do the other threads get run, as in equally as often as the EM thread > does? (Does EM just call ruby_go_ahead_and_context_switch every so often or > what not?) > Does EM buffer in the background while the other threads run, by chance?EM is interoperable with Ruby threads. While Ruby code is running (whether its Ruby code called by EM or running on other Ruby threads), the kernel''s network drivers will still be doing their thing, so a certain amount of data will be buffered and dispatched. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20071017/266a2cac/attachment.html
> > EM is interoperable with Ruby threads. While Ruby code is running (whether > its Ruby code called by EM or running on other Ruby threads), the kernel''s > network drivers will still be doing their thing, so a certain amount of data > will be buffered and dispatched. >I assume network kernel buffers'' size is not customizable :) Also just to make sure I understand what happens--say you''re running Ruby code for 1s, then it reverts to EM, and EM had open connections during that time that all filled their buffers. EM will then empty the buffers for every established connection (into its own buffers), then proceed to process 1 of the connections'' incoming data. Is that about right? The related question, from my other email, is will EM buffer arbitrary amounts of data on its send queue--like big_msg = "a"*1000000; send_data big_msg or what not. Just wondering. -Roger -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20071017/0c92e86d/attachment-0001.html