Re: gtk2 multithreaded programming win32 issue

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

 



On Thu, Aug 28, 2008 at 5:23 PM,  <jcupitt@xxxxxxxxx> wrote:
> Hi,
>
> 2008/8/28 Kuang-Chun Cheng <kcc1967@xxxxxxxxx>:
>> My GUI require update after some non-gui thread finish it's task.
>>
>> So I create an idle callback + GAsyncQueue in main thread.
>> When non-gui thread push message to GAsyncQueue, my idle callback will
>> be wakeup and do the GUI update.
>
> You don't need the GAsyncQueue. Just call g_idle_add() from the
> non-gui thread and the idle callback will run in the gui thread next
> time the main loop is idle. I do this in my app and it works well on
> linux and windows.
Hi John,

Could you explain more on this ?  Is calling g_idle_add() from
"NON-GUI" thread important ?   I think no matter which thread invoke
g_idle_add(),
the idle callback will be associated with default main loop, am I correct ?

Did you put a g_usleep() in your idle callback ?  If not, how did you avoid
the idle callback to take all of the CPU loading ?

Thanks
KC



>
> John
>
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux