Re: Creating threads within widget draw routines ..
- From: Havoc Pennington <hp redhat com>
- To: Paul Davis <paul linuxaudiosystems com>
- Cc: The Surprises <thesurprises1 attbi com>, gtk-list gnome org
- Subject: Re: Creating threads within widget draw routines ..
- Date: Thu, 21 Nov 2002 10:20:56 -0500
On Thu, Nov 21, 2002 at 09:30:42AM -0500, Paul Davis wrote:
> >thread wake up and draw the updates. A simple way to wake up the main
> >thread is to just gtk_widget_queue_draw() on the display area from the
> >secondary thread, or just add a one-shot idle function yourself to the
> >main GMainContext. Or something along those lines, I haven't written a
> >threaded app myself.
>
> last time i looked, neither of these functions are thread-safe, and so
> the caller must still use explicit locking around calls to them.
>
You have to lock to queue draw, but then the actual drawing happens in
the main thread, and the queue_draw should result in installing an
idle handler which should result in waking up the main thread if the
main thread was blocking.
g_idle_add() is intended to be thread safe I believe. (It locks the
GMainContext for you.)
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]