KWIG Qt->Gtk porting layer and merging main loops.
Owen Taylor
otaylor at redhat.com
Fri Oct 29 06:19:46 EEST 2004
On Wed, 2004-10-27 at 16:29 -0400, Avery Pennarun wrote:
> On Wed, Oct 27, 2004 at 10:06:05PM +0200, Lennart Poettering wrote:
>
> > Avery wrote:
> > > If we can manage to agree on a common standard, that would be perfect.
> > > I think libevent should be that standard. Just grab it and use it; it's
> > > the basic model that everything else is based on anyway. I'm pretty
> > > sure glib's mainloop stuff is sufficiently flexible that you can
> > > probably do this pretty transparently. Qt, I'm not so sure. Something
> > > about QSocketNotifier.
> >
> > You know the main loop abstraction layer library liboop, don't you?
> >
> > http://www.liboop.org/
>
> I didn't know about this, but it looks good. Awfully similar to libevent,
> though, despite the author's claims to the contrary.
>
> I'm sure nobody cares, but I'll go on record as saying that if
> freedesktop.org can convince *either* Qt or Glib to make their default
> mainloop based on either libevent or liboop, I'll be happy to do the same
> with wvstreams :)
Quick summary:
libevent is seriously too simple:
- Not thread safe
- Doesn't support multiple independent main contexts
- Fails the "can you write an X event source as a callback" test
(Requires special handling because XPending() can become true
between calls to select())
I'm not arguing that you need the level API complexity of GMainLoop,
but anything that wouldn't allow that level of complexity to be
be built on top isn't usable.
liboop has similar "too simple" problems
- Not thread safe
- Fails the "can you write an X event source as a callback"
But because it's essentially just some glue around tiny little vtable
maybe it's less of a problem... You could trivially implement
g_main_context_get_oop_source(), though not the reverse.
I'm not sure what that would buy you though. What you want is that
two libraries in the same process space can automatically hook up
to the same main loop without manual intervention. A standardized
event loop vtable doesn't seem to get you there.
Could something like libevent be written that was actually compelling
enough so I'd want to use it in GLib? Probably. But the bar is high.
Basically, it would have to be solving portability problems for us
rather than creating them.
Regards,
Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/xdg/attachments/20041028/fdd7eab9/attachment.pgp
More information about the xdg
mailing list