Masaki Fukushima <fukusima / goto.info.waseda.ac.jp> writes: > Ian Main <imain / gtk.org> wrote: > > > * Toolkit must provides select substitution API such as > > > g_main_set_poll_func(). I don't know that other toolkits than > > > GTK provide one. > > > > and g_timeout_add for sleep () etc. right ? This is what I was thinking. > > Hmm... > We probably think a bit differently. > > I have no intention of using g_timeout_add(). In my approach, > Ruby scheduler is dominant and GTK mainloop is a Ruby thread. So > there is no need of telling timeout to GTK. > > Brief description of my proposal: > > * Implement a poll_func using rb_thread_select(). The poll_func > provides the same facility as select(). > > * Register the poll_func to GTK by g_main_set_poll_func(). > Then enter GTK mainloop. > > * When GTK mainloop invokes the poll_func, the poll_func calls > rb_thread_select() and the control comes back to Ruby > scheduler. This approach sounds like it is specific to Gtk. It would be nice to have a more general approach, which would allow Ruby to be embedded in other applications in the future. Is this possible? Dave