How to ensure that exactly one process is running on a given processor/core

cpu usagemulti-processorprocess

I would like to do this so I can accurately speed test my processes, and just to be able to have the illusion of control.

Maybe I want to reserve one processor for special programs. Maybe I want to write my own process optimizer. Who knows. The possibilities are endless in my mind.

Is this possible in any OS? If not why not? If we are allowed to compartmentalize memory, why can't we have such control over processors?


Best Answer

  • On Linux, cpusets should work for this.