a glib main loop for receiving signal in a single thread may block other threads?

htbegin hotforest at gmail.com
Mon Oct 5 05:30:17 PDT 2009


Hi,

I'm trying to write a simple demo to receive signal in a single thread
and I use the glib
main loop(the code of the demo is attached). However it seemed that
the thread running the glib main loop block other
threads. I add some logging statements in the main thread, but it just
output the log
one time and then nothing is logged out.

But when signal was received in the signal handler thread, the main
thread output the log
again and again only one time. And I use ps to watch the kernel
function on which the current
process is sleeping, found that the main thread is sleeping on futex_wait.
--------------------------------------------------------------------------------
  PID   LWP WCHAN                     CMD
 2989  2989 futex_wait                python try.py
 2989  2990 poll_schedule_timeout     python try.py
-------------------------------------------------------------------------------

The version of dbus-python I used is dbus-python-0.83.0 by Fedora.
Could anyone tell me what is the problem and how should I fix it ?

Forgive for my poor English.
Thanks.

hotforest
-------------- next part --------------
A non-text attachment was scrubbed...
Name: try.py
Type: text/x-python
Size: 776 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20091005/030d2d11/attachment.py 


More information about the dbus mailing list