I am trying to asynchronously open and read a large text file (20MB) into a GTK text buffer. I have been successful at opening and reading the whole file at once, which is not elegant.

So, if you have a 20M file and you're doing 4k requests,
gnome-vfs is going to have a queue of about 5120 read requests, which
will end up in 5120 read() calls and 5120 calls to your read_cb.

It'd probably be a lot more efficient to read more than 4K at a time, and
not put so high load on the communication between the threads inside
gnome-vfs. Are the asynchronous callbacks in gnome-vfs called from
the same thread?
If read_cb is called from another thread you'll have problems inserting
data into the text buffer.

You can also experiment in waiting for the result before sending more read
requests, so you keep the queues in gnome-vfs smaller.

--
Johan Dahlin <[EMAIL PROTECTED]>
Async Open Source


begin:vcard
fn:Johan Dahlin
n:Dahlin;Johan
email;internet:[EMAIL PROTECTED]
x-mozilla-html:FALSE
version:2.1
end:vcard

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to