src: use priority queue to run worker tasks · nodejs/node@a5d0166 · GitHub
Skip to content

Commit a5d0166

Browse files
joyeecheungRafaelGSS
authored andcommitted
src: use priority queue to run worker tasks
According to the documentation, the v8 tasks should be executed based on priority. Previously we always execute the tasks in FIFO order, this changes the NodePlatform implementation to execute the higher priority tasks first. The tasks used to schedule timers for the delayed tasks are run in FIFO order since priority is irrelavent for the timer scheduling part while the tasks unwrapped by the timer callbacks are still ordered by priority. PR-URL: #58047 Refs: #47452 Refs: #54918 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
1 parent d2f5ceb commit a5d0166

2 files changed

Lines changed: 109 additions & 45 deletions

File tree

src/node_platform.cc

Lines changed: 66 additions & 39 deletions

src/node_platform.h

Lines changed: 43 additions & 6 deletions

0 commit comments

Comments
 (0)