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.

________________________________________________________________
Mathieu Bouchard                   http://hostname.2y.net/~matju