Signals & threads - low level C API [Newbie question]

Krishna R sith.list at gmail.com
Fri Jan 26 11:24:55 PST 2007


Thiago,

Thanks for the reply.


> What function did you call in the processing thread? If you called
> dbus_connection_read_write, it'll block on the socket access. You need to
> release the transport to make other threads work.
>
> In other words, you need a full mainloop in your thread: a select(2)-based
> socket notifier and timer implementation.



I use dbus_connection_read_write_dispatch and a  filter func that just does
dmessage_get_args and returns NOT_YET_HANDLED.

The send thread does something like this

dbus_bus_get()
dbus_message_new_signal()
dbus_message_append_args()
dbus_connection_send()
dbus_connection_flush()

All the calls other than flush returns without error. I assume thats because
they dont use the transport?

Do i still need the main loop you are talking about in the above simple
scenario?

Thanks,
-K
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20070126/3fc83d27/attachment.html


More information about the dbus mailing list