[Top][All Lists]

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

dbus-call-method takes a minimum of 100ms per call?!

From: Daniel Colascione
Subject: dbus-call-method takes a minimum of 100ms per call?!
Date: Sun, 16 Feb 2014 21:15:19 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

It looks like Emacs executes dbus calls by starting an asynchronous call, then checking every 100ms for it to finish. This strategy makes (require 'secrets) take 1000ms to complete on my machine!

Inside dbus-call-method, there's a loop that looks like this:

(with-timeout ((if timeout (/ timeout 1000.0) 25))
      (while (eq (gethash key dbus-return-values-table :ignore) :ignore)
        (let ((event (let ((inhibit-redisplay t) unread-command-events)
                       (read-event nil nil 0.1))))
          (when (and event (not (ignore-errors (dbus-check-event event))))
            (setq unread-command-events
                  (append unread-command-events (list event)))))))

I think we're supposed to exit as soon as we get a dbus event and short-circuit the timeout, but no such event seems to get delivered, even for successful calls. I can dig a bit into dbusbind.c, but I'm no dbus expert.

reply via email to

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