"Cameron Laird" <claird / starbase.neosoft.com> a ˝─rit dans le message news:
4DAB7C073C4E7F7E.939B65A2F094403A.B5AF9687CDD913D7 / lp.airnews.net...
> In article <LAW2-F290jCRo1OKUTG00007b0c / hotmail.com>,
> Ben Tilly <ben_tilly / hotmail.com> wrote:
> >Andrew Kuchling <akuchlin / mems-exchange.org> wrote:
> >>
> >>"Ben Tilly" <ben_tilly / hotmail.com> writes:
> >> > I suspect that the most common appliation for threading is
> >> > to allow a GUI to be responsive even when the program is
> >> > busy doing something else. ...
> >Multi-threading with real threads is valuable, and can
> >work just fine even if only one thread talks to the GUI.
> .
> In real-world development practice, having only "one
> thread talk to the GUI" is nearly universal.  I can't
> think of any good reason to have more.  I'm keeping an
> open mind on this one, though.
>

What about an application server ?

> Along with the categories Andrew listed, there are a few
> other reasons to use threads:
> 1.  Fashion and misinformation....
> 2.  System-level bindings that only give good
>     programmability for threaded APIs.
> 3.  Mildly tangled with the first two, Ben's
>     cases of external stuff that demands thread-
>     level management....
>

So, to sum things up,
1 - one GUI thread is enough and more is definitely bad.
1 - not having system threads running several copies of the interpreter is
not a major hindrance.
2 - having the interpreter run in only one thread eases the implementation
of the GC.
3 - threads are really useful for :
    * coding style (a very personal matter !!)
    * keeping the system responsive under external API calls.

What triggered this discussion is the fact that some calls in the Ruby lib
actually block according to Dave Thomas excellent book.
All the contributions seem to point in the same direction : providing a
simple worker thread wrapper around some of the extension modules should be
more than enough.
My thought was that if the Ruby API could provide a standard easy worker
threading framework for the extensions module to call, it would be nice.
That way, the interpreter could remain untouched.

I'll try to work on that.
Cheers.