Re: Asynchronous File Reading



On Fri, Feb 09, 2001 at 12:24:06PM -0500, Havoc Pennington wrote:

"Dugas, Alan" <alan dugas analog com> writes:
Does anyone have a suggestion on how I could asynchronously read a file?
I've tried using gtk_timeout_add()/gtk_timeout_remove(), but this causes
"racing" conditions when run over a network.  Any ideas would be greatly
appreciated.


Sure, use g_io_add_watch().

Havoc

What about gdk_input_add and gtk_input_add ?

g_io reference docs seem to imply the use of gtk_input_add_full:

http://developer.gnome.org/doc/API/2.0/glib/glib-io-channels.html
"""
GTK+ contains the convenience function gtk_input_add_full() which creates a 
GIOChannel from a file descriptor and adds it to the main event loop.
"""

gtk_input_add seems to be a wrapper around gdk_input_add which,
according to the reference docs, imply the use of g_io:

http://developer.gnome.org/doc/API/2.0/gdk/gdk-input.html
"""
See Also

GLib Main Loop

     The main loop in which input callbacks run.

IO Channels

     A newer and more flexible way of doing IO callbacks.
"""

I take it g_io is the best one to use??





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