I have 24 compute intensive processes, each process running in a single thread, each running about 2 hours. I'm on a 8 core CPU.

Does it make a difference on the total run time, if I run all 24 processes at the same time in contrast to running only 8 processes simultaneously?

I'm speaking of coordination overhead between the processes, so in this case each CPU would be assigned 3 processes - is this overhead significant?

1 Answer 1


This will depend on your specific workload and more details of your architecture (e.g., do the processes read the same memory, which may be on separate NUMA nodes?), so it would be best if you could measure performance and see what you get.

Running 24 CPU-intensive tasks over 8 execution units will require scheduling tasks on and off, whereas running as many tasks as execution units should in principle require less switching. I wouldn't expect that the overhead related to running code to switch between tasks is that high, but, when a task is scheduled off a CPU, one effect is that the state of that CPU's caches risks being flushed (they are likely to become useless for the new task being scheduled); if this happens often enough, it could lead to degraded performance.

In your case, it may make sense to benchmark those three against each other:

  1. Run 24 concurrent tasks;
  2. run 8 tasks;
  3. run 8 tasks, assigning a specific CPU to each of them.

You can do (3) using e.g. cpuset on Linux.

  • That's a pretty simplistic answer, perhaps someone can contribute something more thorough.
    – dhag
    Commented Mar 7, 2017 at 18:41
  • Linux is pretty good at not migrating threads between CPUs when it would hurt performance, I doubt that cpuset would improve anything. Commented Mar 8, 2017 at 1:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .