[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading D-Bus messages

From: YAMAMOTO Mitsuharu
Subject: Re: Reading D-Bus messages
Date: Sun, 16 Aug 2009 09:09:08 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shij┼Ź) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Sat, 15 Aug 2009 21:16:54 +0200, Michael Albinus <address@hidden> said:

> I've written a function xd_pending_messages, which uses internally
> dbus_connection_get_dispatch_status. By this I could avoid select()
> on the file descriptor. D-Bus messages are now received without
> keyboard input, also when Emacs runs in terminal mode. However,
> there is a delay of some seconds.

> xd_pending_messages is called in readable_events, which means that
> it is checked inside wait_reading_process_output. Is there a
> possibility to trigger a more frequent check via
> detect_input_pending?

While Emacs is idle, it blocks at the select() call in
wait_reading_process_output waiting for one of the several kinds of
events to happen: window-system events, subprocess output arrivals,
socket status changes, signal arrivals, and timer expirations.  That's
why it is important to have a file/socket descriptor to monitor for
D-Bus in order to avoid consuming CPU time for polling.

As far as I browsed some D-Bus documents,
dbus_connection_set_watch_functions seems to have something to do with

                                     YAMAMOTO Mitsuharu

reply via email to

[Prev in Thread] Current Thread [Next in Thread]