GTK, threads and accessibility - application hangs



Hi,

I would like to know if it's forbidden by design to run gtk_main() in 
a thread other the "main" one or the one where gtk_init() was called.

My GTK applications hang when accessibility is enabled and gtk_main() is 
outside the "main" thread.

This problem started as a PyGTK issue, but after some tests it occurred 
that it could as well be a general GTK question.

I couldn't find the answer in the documentation.

Discussions I've found using Google and searching through this archive 
didn't give me an answer. Sometimes the code was a part of a bigger 
project and it dragged a thread from the main question. So I've created 
a couple of snippets of code using GTK and threads. Code is in 
a repo[1].

This is the summary:
                                         |   hang   |
-----------------------------------------+----------+
python/primarythread_gobject.py          |   no     |
python/primarythread_gtkgdk.py           |   no     |
python/secondarythread_gobject_import.py |   no !   |
python/secondarythread_gobject.py        |   yes    |
python/secondarythread_gtkgdk_import.py  |   no !   |
python/secondarythread_gtkgdk.py         |   yes    |
python/multiprocessing_gobject.py        |   no     |
cpp/primarythread.cpp                    |   no     |
cpp/secondarythread.cpp                  |   yes    |
cpp/secondarythread_init.cpp             |   no !   |

!   ** (secondarythread_gobject_import.py:5828): CRITICAL **:
giop_thread_request_push: assertion `tdata != NULL' failed
  -- at the application termination


I would like to know if "secondarythread" variants are correct or did 
I violate some GTK rules.

Both for Python and C++ secondarythread variants seem to hang when using
/usr/lib/libORBit-2.so.0. Only in this variant link_set_io_thread() 
inside giop_thread_new_check() is called, which leads to executing 
g_main_loop_run(). Backtrace available in the repo. Is there a bug in 
libORBit?



There was some discussion at StackOverflow[2] and I've asked the 
question on the PyGTK mailing list[3] but got no answer.

[1] https://bitbucket.org/wodny/pygtk-threads
[2] http://stackoverflow.com/questions/7010004/pygtk-threads-and-accessibility-application-hangs
[3] http://www.daa.com.au/pipermail/pygtk/2011-August/019921.html

-- 
Marcin Szewczyk                       http://wodny.org
mailto:Marcin Szewczyk wodny borg  <- remove b / usuń b
xmpp:wodny ubuntu pl                  xmpp:wodny jabster pl


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