Tracking DBusWatches

Havoc Pennington hp at redhat.com
Fri Feb 9 08:30:43 PST 2007



tsuraan wrote:
> 
> Ok, so what I'm doing (and it is working, so far) is dedicating a thread 
> to read_write_dispatch.  It always calls that, with a -1 timeout.  In my 
> main thread, I am doing send_with_response, and it is also working.  The 
> response callback registered with pending_call_set_notify is obviously 
> run in the dispatcher's thread, but I handle that without any trouble.  
> I don't really have much experience with multi-threaded programs or 
> low-level sockets, but all this discussion of read_write_dispatch 
> blocking the socket would make me think that what I'm doing shouldn't 
> work.  What is the problem with blocking sockets, and am I on the edge 
> of hitting it?

This should be fine (with as you say the problem that your reply 
notifier is run in the other thread). The problem I mentioned would 
happen if you used send_with_reply_and_block(), because only one thread 
can block at a time or one of them gets stuck waiting for the socket lock.

Havoc



More information about the dbus mailing list