Re: Multithreaded gtk apps
- From: Phillip Susi <psusi ubuntu com>
- To: Andy Spencer <andy753421 gmail com>
- Cc: ML-gtk <gtk-list gnome org>, Paul Davis <paul linuxaudiosystems com>
- Subject: Re: Multithreaded gtk apps
- Date: Mon, 14 Jan 2013 23:48:41 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 01/14/2013 11:36 PM, Andy Spencer wrote:
> If I understand correctly, I tried something like that once too,
> using something like the example from the manual:
>
> while (gtk_events_pending ()) gtk_main_iteration ();
My understanding is that you should never do that and I am currently
getting rid of instances where gparted does that, and instead you
should do gtk_main_loop(), which basically does that, but while
properly sleeping for more events, and handling locks and other things.
What I meant was to call gtk_main_context_acquire() which claims the
context for the current thread, allowing it to then run the other
functions to handle events. The problem with that seems to be that
the main thread must explicitly gtk_main_context_release(), rather
than the acquire simply being allowed to happen when the main thread
is blocked anyhow.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/
iQEcBAEBAgAGBQJQ9N+pAAoJEJrBOlT6nu75434IAIXpwbTYmfm8VLkm9ZjjapMY
beWHo98KcP0rv1ZzAlRHHiZ81VQCX9OYLR0cACoKiRlCRzGiDSbJzhBN2ReDf8/U
kmeef2bKsABF5jGKsb7FSU+2xJLeeOiupF5WFY14zp+6uXDOw+WvOHG27TiKTCWR
4yooNomQv6qLG3eF0+LZdPKKtIPGuK5g5B9sLAdCWUuYmX7y0qVT/HNyNKe+FxaL
HW8l5UD+cRKlKAPrsJUagnjP17HgEN3cppDOOUD3RSR93Ji/3sE2NJXJqv7FZd6q
KqrL9zRZQnae5GTYs1jwyRrH6yWNVJyZhlnZTmBSbool8IDnL1pffJLf3QAymmc=
=ilVe
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]