GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: refactored scheduling policy assignment · nodejs/node@94d0a08

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/cluster
    • master.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/cluster/master.js‎

Copy file name to clipboardExpand all lines: lib/internal/cluster/master.js
+11-10Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,17 @@ let debugPortOffset = 1;
3737
let initialized = false;
3838

3939
// XXX(bnoordhuis) Fold cluster.schedulingPolicy into cluster.settings?
40-
let schedulingPolicy = {
41-
'none': SCHED_NONE,
42-
'rr': SCHED_RR
43-
}[process.env.NODE_CLUSTER_SCHED_POLICY];
44-
45-
if (schedulingPolicy === undefined) {
46-
// FIXME Round-robin doesn't perform well on Windows right now due to the
47-
// way IOCP is wired up.
48-
schedulingPolicy = (process.platform === 'win32') ? SCHED_NONE : SCHED_RR;
49-
}
40+
let schedulingPolicy = process.env.NODE_CLUSTER_SCHED_POLICY;
41+
if (schedulingPolicy === 'rr')
42+
schedulingPolicy = SCHED_RR;
43+
else if (schedulingPolicy === 'none')
44+
schedulingPolicy = SCHED_NONE;
45+
else if (process.platform === 'win32') {
46+
// Round-robin doesn't perform well on
47+
// Windows due to the way IOCP is wired up.
48+
schedulingPolicy = SCHED_NONE;
49+
} else
50+
schedulingPolicy = SCHED_RR;
5051

5152
cluster.schedulingPolicy = schedulingPolicy;
5253

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.