[dbus][python] Method dispatch also single-threaded?

tsuraan tsuraan at gmail.com
Mon Jan 22 14:49:46 PST 2007

> Well if your service object isn't returning to the mainloop or starting
> up a thread it isn't going to process the next call until it is done
> with the first call.   Async calls only have to do with making sure the
> client doesn't block.  If you don't want your server to block on long
> running calls you need to return to the mainloop sooner than later.  It
> is the same issue as with gui blocking.  If you call a function which
> doesn't return to the mainloop your application's gui doesn't respond.
> You need to either run your calculations in a thread or defer sending a
> reply and doing your calculations in an idle handler.  Remember though,
> you have around 25 seconds to get an answer back to the client if it
> uses the default timeout.

So, in order for my example to work, each of the functions would need to set
a timer, probably to emit a dbus signal, and then return immediately?
Normally, server frameworks offer some sort of threaded-reply model so that
the core dispatcher doesn't block when a handler function misbehaves.  I
take it that's impossible with the current dbus/glib mainloop, because
everything has to be done cooperatively, right?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20070122/e3f48798/attachment.html

More information about the dbus mailing list