Re: Xlib: unexpected async reply (sequence #####)!



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

Chris Vine wrote:
On Sat, 2007-08-04 at 22:07 +0800, Gregory Hosler wrote:
That threads_enter/threads_leave doesn't look so bad, since I'm not doing alot
of gtk withing my thread. Looks like it might be the way to go for me.

You may be missing the point.

In reviewing things (after seeing your email, thanks!) indeed I missed the
points / significance about g_idle_add().

If you access GTK+ from more than one
thread, then all operations with GTK+ need to protected with the GDK
lock, in any thread


including in the main GUI thread.

The main loop is already protected (by threads_enter()/threads_leave() so I
didn't need to add any code at all to the main code (and I don't have any
timeout callbacks either), so the only places I needed to add the
threads_enter/leave was in the threads (2 small ones) themselves.

having said that...

That is why
using g_idle_add() is often a better approach.

just looked at the man/devhelp page. Looks interesting. I'm looking for some
code examples. actual working examples would be nice.

Anyone know of any projects that use this approach?

Many thanks for the "heads up" and best rgds,

- -Greg


Chris




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

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

| Greg Hosler                                   ghosler redhat com    |
+---------------------------------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGtULR404fl/0CV/QRAp8MAKDiRn1Q3PZBJFOrgpOj/cpDE6j3HwCg2dCH
HzJL4sKYwHkmUnx1fMkdCjg=
=Yg7O
-----END PGP SIGNATURE-----



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