Re: To spawn or not to spawn? This is the question...



The Saltydog wrote:
I have an application that performs deep directory recurrent scanning.
During such scan, at each iteration, I execute   while
(gtk_events_pending()) { gtk_main_iteration(); }        in order to keep the
GUI updated from the directory scans results. It works fine, at an
acceptable speed.

Now my question: is it worth, in terms of application speed, to spawn
the reccurrent iteration and get the data thru a pipe, instead of
directly sending the data to the display routine?

Your application might respond better if each itteration was executed
in a g_idle_add callback instead of hijacking the mainloop, also;
if you use threads for this you dont have to bother with all the
gdk_threads_enter/leave stuff as long as your child thread is just
a worker thread, it can communicate with a GAsyncQueue.

Whether this is "worth it" is entirely up to you, ask yourself how
responsive the application has to be and also how unresponsive it
will get when faced with huge datasets.

Cheers,
                            -Tristan



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