On the for loop on line 7 put a breakpoint. Run F5.
Program will never exit. Run without debugging it will end.
```
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on('exit', function (worker, code, signal) {
console.log('worker ' + worker.process.pid + ' died');
});
} else {
// Workers can share any TCP connection
// In this case its a HTTP server
console.log("entered worker")
for(var i = 0; i < 10; i++)
console.log("RAND" + Math.random)
for (var i = 10; i < 100; i++)
console.log("exp of " + i + " " + Math.exp(i))
console.log("exited worker")
process.exit(0)
}
```
Comments: The BP might be unnecessary, but I had it so I figured I would mention
Program will never exit. Run without debugging it will end.
```
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on('exit', function (worker, code, signal) {
console.log('worker ' + worker.process.pid + ' died');
});
} else {
// Workers can share any TCP connection
// In this case its a HTTP server
console.log("entered worker")
for(var i = 0; i < 10; i++)
console.log("RAND" + Math.random)
for (var i = 10; i < 100; i++)
console.log("exp of " + i + " " + Math.exp(i))
console.log("exited worker")
process.exit(0)
}
```
Comments: The BP might be unnecessary, but I had it so I figured I would mention