Re: [gtk-list] Re: Threading and glib main

Erik Mouw wrote:
> On Wed, 19 Jan 2000 02:26:54 +0100, Kai Wetzel wrote:
> > I was thinking of using a seperate mainloop for another thread
> > when I realized (read in the reference manual) that the glib
> > main loop is global.  I'd mainly like to watch for input on
> > some fds in a thread which is not the one where the GUI stuff is
> > beeing handled, with as little effort as possible.
> > - use one seperate thread for running the select loop (custom,
> >   not glib) for the other fds.  While a little more work than
> >   the other idea, could Gtk+ live with this and would I just need
> >   to call g_main_wakeup or set an idle handler to "notify" the
> >   main thread carrying select ?
> Why don't you just use gdk_input_add() to watch for the input? No need for
> threading.

Mainly because there may be a significant delay between two
calls to select due to GUI work not returning to the main
loop.  For many proactical purposes I'd probably just use the
function you mentioned.  For now I'll just use the alternative
in code intended to teach me something, probably not for any
real project in the foreseeable future.  Maybe by then glib's loop
has this feature so I don't even have to code around it :)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]