From: Wink Saville Date: 2005-09-12T02:29:42+09:00 Subject: Re: [RFC] The Early Demise of Myriad (Thanks To Ruby Threads) Zed A. Shaw wrote: >Hi Everyone, > >I figured out this weekend that Ruby's Thread implementation causes the Ruby/Event binding I wrote to completely stall and go dead. After reviewing the Ruby source and watching several strace runs, it's clear that the Ruby Thread implementation uses select in a way that--while not being bad--just isn't compatible with libevent. The second a thread is created Ruby assumes it's the only game in town and doesn't relinquish control. > >This basically means that, I have three choices as I see it: > > 1) Ruby/Event becomes completely evil and redefines Thread's initialize so that it throws an exception telling you to not use threads. Ugh. > 2) Implement DRb using Myriad so that people can get the advantages of threads without using them. Also ugh. No protocol specs does not make for a fun time implementing a protocol. And no, source code is *not* a protocol specification. > 3) Abandon Ruby/Event entirely and just base a new implementation of Myriad on the Ruby thread stuff. I know you purists will think this is great, but you do realize that I get *incredible* performance from libevent and that a pure Ruby implementation would only handle as many connections as select supports (which is sometimes 256)? > >I'm writing to get people's feedback on the usefulness of Ruby/Event and Myriad. Take a look at the project: > >http://www.zedshaw.com/projects/ruby_event/ > >I'm seriously leaning toward just dumping the whole thing, implementing a simple SCGI setup in pure Ruby since that's the most useful part, and then working on FastCST again. > >Tell me if, given this new information, you think Myriad and/or the Ruby/Event bindings would still be useful. Also if you'd accept one of the above options. > >Thanks for your time and your opinion. > >Zed A. Shaw >http://www.zedshaw.com/ > > > Hello, I'm a Ruby newb but have been programming for many years and have been attracted to Ruby from the good things I've read about it on the Net. I'm responding to the RFC because we've implemented a messaging system in C and have been investigating adding messaging to Ruby. The could be relevant to this discussion because my understanding is that Ruby/Event's main purpose is provide asynchronous notification to a application which is the same purpose of the messaging system. In the messaging system we've done, the messages are sent and processed asynchronously, and sending a message will be guaranteed never to block the sender and the receiver receive one message at a time. This has profound effect that a system can be composed of many (100's or 1000's or ...) of independent objects (threads/components) all communicating and working without the need for mutual exclusion objects (mutex/critical sections). Is there any reason to believe this won't work? Zed, does this strike you as interesting or related? Is this interesting to anyone else? Regards from a newb, Wink