Re: glib branched



On Wed, Oct 03, 2012 at 09:06:19AM +0200, Bastien Nocera wrote:
> Popping results out of a running thread is easy to do.
> 
> Create a GAsyncQueue.
> In your thread, add your results to the queue, a schedule a function to
> be called from the main loop with g_idle_add().
> 
> In your g_idle_add() callback, use g_async_queue_pop() to get the
> results, and free your results.

I know this approach and it is not what I call monitoring because it is
worker-initiated.  I only want to report progress if and when someone
asks.  Otherwise either you have to very carefuly tune the work chunk
sizes, or you get skippy status updates sometimes and too much
communication other times.

But OK, I will continue to implement these things myself...

Regards,

Yeti



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