#82 broken semantic-idle timer management with emacs-22.0.5

closed
nobody
semantic (53)
5
2007-02-08
2006-09-14
Anonymous
No

Having semantic-idle enabled causes CPU consumption to
stick at 100% whenever emacs becames idle.

My environment:
Gentoo Linux gcc-4.1.1/glibc-2.4
CEDET-1.0_pre3
emacs-cvs 22.0.50

It seems to be caused by a change in the behavior
run-with-idle-timer/cancel-timer in emacs-cvs (22.0.50)
which have been used to implement
semantic-idle-scheduler-setup-timer and
semantic-idle-scheduler-kill-timer. Basically, while
idle, re-scheduling an idle-timer previously canceled
causes it be re-activated instantaneously (live-lock)

Semantic-idle seems to have used such scheme to protect
against multiple activations is case of an idle
interval was not enough to complete the parsing
previously started.

I've fixed the bug in my instalation by replacing the
timer cancelation scheme by other that just delays a
lot (actually 1 hour) the next activation while the
parsing is in course. After it finishes, the default
delay is restored.

I attach my new implementations of
semantic-idle-scheduler-setup-timer and
semantic-idle-scheduler-kill-timer

Luciano

Discussion

  • proposed fix to semantic-idle

     
    Attachments
  • Logged In: NO

    I've found in emacs-cvs logs the commit that is causing the
    problem:

    lisp/emacs-lisp/timer.el
    ----------------------------
    revision 1.12
    date: 2006-08-20 09:16:26 -0300; author: rms; state: Exp;
    lines: +3 -1
    (run-with-idle-timer): Pass t to timer-activate-when-idle,
    so timer can run before Emacs becomes non-idle again.
    ----------------------------

    Given that, a better solution then that I have previouly
    sugested would be to give up on run-with-idle-timer/
    cancel-timer and play directly with timer-activate-when-idle.

    []'s

    Luciano

     
  • Logged In: YES
    user_id=417980
    Originator: NO

    I think this is fixed in the current cvs version.

     
  • Eric M. Ludlam
    Eric M. Ludlam
    2007-02-08

    Logged In: YES
    user_id=88537
    Originator: NO

    I was CC'd to email to the effect that this was resolved in Emacs/CVS.

     
  • Eric M. Ludlam
    Eric M. Ludlam
    2007-02-08

    • status: open --> closed