Re: Data available for reading in a GIOChannel
- From: Tristan Van Berkom <tvb gnome org>
- To: Robert Pearce <rob bdt-home demon co uk>
- Cc: gtk-list gnome org
- Subject: Re: Data available for reading in a GIOChannel
- Date: Wed, 30 May 2007 09:52:03 -0400
On Tue, 2007-05-29 at 22:42 +0100, Robert Pearce wrote:
> On Tue, 29 May 2007, Jonathan Winterflood
> <jonathan winterflood gmail com> wrote :
> >
> >A question arises, though: is it possible that the channel will recieve
> >the last of the data between the
> >time g_io_channel_read_chars returns G_IO_STATUS_AGAIN and the callbac
> >k exits, and that the callback will not be called again?
>
> I don't think so, but given that somebody posted "from experience" that
> the callback is reentrant (which I didn't think was possible) perhaps
> I'm wrong. On the other hand, I've written code that assumes both
> non-reentrant and that any extra data arriving during the callback will
> result in it being called again, and I've never hit a problem.
A GIOWatch function is definitly not reentrant, a mainloop runs in a
single thread, you could have set up a mainloop and GMainContext to
handle a mainloop in a second thread, even there your GIOWatch callback
will not be reentrant.
This document describes what the mainloop does:
http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]