Re: [Discuss] Make a thinner Glib/GTK+ to fit tiny device better
- Date: Mon, 19 Oct 2015 19:46:12 +0800
- From: cee1 <fykcee1@xxxxxxxxx>
- Subject: Re: [Discuss] Make a thinner Glib/GTK+ to fit tiny device better
2015-10-17 1:26 GMT+08:00 Emmanuele Bassi <ebassi@xxxxxxxxx>:
> On 16 October 2015 at 18:15, cee1 <fykcee1@xxxxxxxxx> wrote:
>> The idea here is trying to make a thinner event loop.
> You keep using that word, "thin". I don't think it means what you
> think it means.
> You have consistently failed to bring any measurement, or any metric,
> that would allow you (or anybody else) to identify what's the current
> state of GLib, and how would we identify a "thinner" version of GLib.
> Saying that you want a "lightweight" version of GLib is pointless, if
> you also don't define a system of measurement that defines what
> "lightweight" even means.
Yeah, a profile/measurement is necessary when discuss '*thin*'. While
on the other hand, IMHO, comparing similar libraries which deploying
different approaches may inspire some ideas. Here, as an example: the
COW approach to remove duplication, a simpler event loop ...
Quite frankly, GMainLoop seems a little complicated to me, especially
compared with the event handling in GCD. Hence, I'm wondering
whether I can combine an external event loop without GMainContext
>> I'm wondering is it a thinner and cleaner implementation, that
>> GTK+/GIO/etc provide hooks and let client or utility/glue library use
>> these hooks to put GTK+/GIO/etc into their event loop.
> The idea is to have a fd-based interface that lets you extract a
> (pollable) descriptor from GMainContext, and additional main loops can
> poll on that; see the (lengthy) discussion on:
Thanks for pointing out this patch out :)
In this patch, the iteration of the event loop is
poller->funcs->iterate(), take epoller as an example, which will then:
1. Invoke g_main_loop_prepare_poll() to invoke GSource.prepare, and
notify epoller to update epoll_fd through "add_fd / modify_fd /
remove_fd" in context_update_poller().
2. Do epoll()
3. Invoke g_main_loop_process_poll() to run GSource.check and GSource.dispatch.
It is a big step to utilize scalable event loop implementation, while
still a little complicated...
gtk-devel-list mailing list