[#1263] Draft of the updated Ruby FAQ — Dave Thomas <Dave@...>

33 messages 2000/02/08

[#1376] Re: Scripting versus programming — Andrew Hunt <andy@...>

Conrad writes:

13 messages 2000/02/15

[#1508] Ruby/GTK and the mainloop — Ian Main <imain@...>

17 messages 2000/02/19
[#1544] Re: Ruby/GTK and the mainloop — Yasushi Shoji <yashi@...> 2000/02/23

Hello Ian,

[#1550] Re: Ruby/GTK and the mainloop — Ian Main <imain@...> 2000/02/23

On Wed, Feb 23, 2000 at 02:56:10AM -0500, Yasushi Shoji wrote:

[#1516] Ruby: PLEASE use comp.lang.misc for all Ruby programming/technical questions/discussions!!!! — "Conrad Schneiker" <schneiker@...>

((FYI: This was sent to the Ruby mail list.))

10 messages 2000/02/19

[#1569] Re: Ruby: constructors, new and initialise — Yukihiro Matsumoto <matz@...>

The following message is a courtesy copy of an article

12 messages 2000/02/25

[ruby-talk:01588] Re: Ruby/GTK and the mainloop

From: Masaki Fukushima <fukusima@...>
Date: 2000-02-26 06:51:32 UTC
List: ruby-talk #1588
Ian Main <imain@gtk.org> wrote:
> GTK has good facilities for this.. from looking through ruby source code
> again, it looks like ruby needs only:
> 
> * The ablity watch file descriptors for read/write readiness.
> * A timeout for sleep() and similar functions.

Yes, and select system call exactly provides these facilities.

And these facilities are also enough for GTK, aren't they?
So the simplest solution is the integration of select, IMHO.
Fortunately, GTK provides g_main_set_poll_func() for this purpose.

The advantage of this approach is the simplicity.  Both GTK and
Ruby can assume mainloop control.  GTK mainloop can be considered
as a Ruby thread.  Ruby thread scheduler yields the control to
GTK when GUI event occurs.

The problem with this approach:

 * Toolkit must provides select substitution API such as
   g_main_set_poll_func().  I don't know that other toolkits than
   GTK provide one.

 * rb_thread_select() needs improvement to avoid busy wait with
   more than one thread.  This involves eval.c hacking...

> Hopefully I am not missing any issues here.. if someone knows something I
> don't please let me know! :)

My approach lacks the point of embedding Ruby as your Entity.
Plese tell me if you find something wrong with this approach.


Masaki Fukushima

In This Thread