Open Bug 1818344 Opened 3 years ago Updated 3 years ago

Low priority timers should be dispatched at a priority lower than normal

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

ASSIGNED

People

(Reporter: florian, Assigned: florian)

Details

Attachments

(1 file)

Currently all timers are dispatched at a normal priority. This is confusing as the timer API exposes the following types that sounds like they would cause the timer callback to run at a lower priority:

  • TYPE_REPEATING_SLACK_LOW_PRIORITY
  • TYPE_ONE_SHOT_LOW_PRIORITY

I'm not sure what the actual priority should be. The attached patch uses EventQueuePriority::Low, but I mostly put it up there for discussion.

I think what low priority means in the nsITimer API isn't very well defined, so it's probably a matter of guessing what behavior the developers who used them wanted to have.

lower priority timers don't have anything to do with priority on the target thread. They are there just for idle handling.
Perhaps their name should be changed though.

I'm fine adding some mechanism to lower the priority, but let's not break the existing API.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: