From: Jef Peeraer Date: 2001-11-09T19:27:27+09:00 Subject: [ruby-talk:24752] Re: callback/event <-> threads Mathieu Bouchard wrote: > > On Wed, 7 Nov 2001, Jef Peeraer wrote: > > the code + weak OO features in perl. At the other hand, for all io, we > > are using this callback/event loop programming paradigm, and i must say, > > it works great, no hasles about deadlocked threads, mutexes, etc... > > I have the impression that ruby prefers the threading-model. Can i still > > use my event/callback stuff ? Is there a reason why the threading model > > is preferred over callback/event in ruby ? > > In Ruby you often have the choice. For example, IO/File/Socket are at once > thread-friendly and offering non-blocking mode. Many libraries will > require use of threads but only in well-defined ways, and GUI toolkits > normally won't use threads. You also have "Continuation", which is a > thread-like construct that you control manually. > > The MetaRuby library (see RAA; current version 0.7) has a program file > called MainLoop.rb that offers three services: filehandle events, timer > events, and "user" events, in one big MainLoop. > Ok, so I should not have to start learning this threading stuff. I will have a look at this meta library. The more i read about ruby, the more i get attracted to it. I just have to find a project where i can use it. Cheers Jef