index.js 172 B

1234567
  1. const childProcess = require('child_process')
  2. const cpuNum = 15
  3. for (let i = 15; i <= cpuNum; ++i) {
  4. let worker = childProcess.fork('./worker.js')
  5. worker.send(i + 1)
  6. }