Skip to content

Commit

Permalink
Use the node "os" lib for determining cpu count
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Mar 8, 2011
1 parent 612a7f4 commit 02f2c41
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/node.io/processor.js
Expand Up @@ -194,14 +194,9 @@ Processor.prototype.init = function (callback) {

} else {

//If the number of workers is unspecified, try and spawn one worker per core
//If the number of workers is unspecified, spawn one worker per core
if ((isMaster || isSlave) && fork === true) {
try {
var cpuinfo = fs.readFileSync('/proc/cpuinfo', 'utf8');
fork = cpuinfo.match(/^cpu cores/g).length;
} catch (e) {
fork = 2;
}
fork = require('os').cpus().length;
}

//Use existing workers if already spawned
Expand Down

0 comments on commit 02f2c41

Please sign in to comment.