------art_27729_30202741.1192216047570
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On 10/12/07, Jay Levitt <jay+news / jay.fm> wrote:
>
> On Fri, 12 Oct 2007 15:18:26 +0900, M. Edward (Ed) Borasky wrote:
>
> So I changed them to stop using the kernel-level message-queuing routines;
> instead, they'd store their requests in a linked list that was kept in a
> different shared memory region.  The cache manager would unlink the first
> request from the list, process it, and link that same request structure
> back onto the "reply" list with a return code.  The requests/replies were
> very small, stayed in processor cache, etc., and there was much less
> context-switching in and out of kernel mode since the queuing was now all
> userland.  This also saved a lot of memory allocate/frees, another
> expensive operation at the time; most message-passing involves at least
> one
> full copy of the message.
>
> Occasionally, the request list would empty out, in which case we had to
> use
> the kernel to notify the cache manager to wake up and check its list, but
> that was a rare occasion, and "notify events" on that system were still
> much cheaper than a queue message.
>
> I would doubt that any of this type of optimization applies to Ruby on
> modern OS's, however.



At the risk of starting a threadjack, I think Ruby is today not as
well-served as some other development products in the way of native
message-passing systems. There is Assaf Arkin's very nice reliable-msg
library, which defines a good API for messaging, and has some support for
persistence. And of course there are several libraries which support Stomp,
making it easier to work with products like Java's AMQ.

I'd like to see a full-featured, high-performance MQ system for Ruby,
however. By "for Ruby" I don't necessarily mean "in Ruby," but rather
tightly integrated and easy/intuitive to use. Doing such a thing was the
original motivation for creating EventMachine, by the way.

------art_27729_30202741.1192216047570--