DBus Pascal bindings implementation
dbus at matthew.ath.cx
Fri Oct 13 06:17:04 PDT 2006
On Fri, 13 Oct 2006, Felipe Monteiro de Carvalho wrote:
> Should I create the binding class as a separate Thread that checks the
> bus? Any other ideas? What do other bindings do about this?
It varies with each language. Several bindings (GLib, QT) expect the
application to hook into the mainloop itself and implement callbacks, so
there is only one thread and the mainloop is run periodically by the
application to check for new DBus message (in fact in some applications
most of the time is spent blocked in the mainloop waiting for a GUI
event or a DBus event etc).
The Java bindings run several Threads, one containing the application,
one containing the code which sends and receives messages and further
threads to run method call and signal handlers in.
It depends how your language normally works with respect to this as how
to do it best; QT and GLib programmers are used to using mainloops
whereas in Java having multiple threads is a common programming method.
How does Pascal deal with this in other situations which contain
More information about the dbus