-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Ne?as (Yeti) wrote:
> On Sat, Aug 04, 2007 at 09:38:25PM +0800, Gregory Hosler wrote:
>> I have a threaded gtk application. The threads create some gui (gtk
>> widgets/windows). and most of the time (maybe 80%) everything works as 
>> expected.
>> Occassionally I will get the message on stdout
>>
>>      Xlib: unexpected async reply (sequence #####)!
>>
>> the ### is an x event sequence number
>>
>> I am suspecting that this is because of the x calls from 2 different threads.
>>
>> Is this a known problem?
>>
>> Any way around this ? (I thought gtk was supposed to be thread ok :)
> 
> The answer depends on your defintions of `OK', `known' and
> `problem':
> - Gtk+ is thread-aware
> - Gtk+ is not thread-safe
> 
> If you operate on the GUI from multiple threads:
> - you are responsible for the locking on Unix/X
> - it will just not work on MS Windows

I'm only interested in X. Any tips/hints/pointers on "locking X" ?

> See
> 
>   http://developer.gnome.org/doc/API/2.0/gdk/gdk-Threads.html

Thanks, I'll take a look.

> People typically operate on the GUI only from the main
> thread (i.e. running gtk_main()) and pass work requests to
> it via g_idle_add() or some other queue mechanism.

This thought occured to me. It's not a lot of gui I have to manage, but managing
it from a thread different from the one using it is a bit of a hassle.

> This topic is discussed here every other week, see the list
> archives.

i CHECKED the archives. honest. I did a search on $SUBJECT, and came up blank.
Maybe I need to broaden my search. Anyway, I'll look at the gdk-Threads doc.
Thanks for that!

> Yeti
> 
> --
> http://gwyddion.net/
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


- --
+---------------------------------------------------------------------+

Please also check the log file at "/dev/null" for additional information.
                (from /var/log/Xorg.setup.log)

| Greg Hosler                                   [EMAIL PROTECTED]    |
+---------------------------------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGtIbI404fl/0CV/QRAh43AKCHVFsMCv9D1nUABDxf3gimiLnzHwCfbQoY
AH02w+3a7Gu/NKNAK5vmocc=
=B/3Q
-----END PGP SIGNATURE-----
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to