Changing the number of CPU Cores running
I want to change the number of cores the CPU uses. One minute I might want all 4 cores running the next only 1 core then back to 3 for example.
I have searched in the hope there was a terminal command that would reduce the cores, not at restart but immediately.
Is anyone aware of one?
________________
I can succeed using Xcode/Contents/Applications/Instruments.app/Preferences/CPUs giving me a slider to change the cores.
When the slider is clicked with the mouse to change the number of cores it requires user and password.
I have managed to run most of the process with Automator/AppleScript but this request for user and password is proving difficult.
In order to avoid it asking I have tried:
entering <DevToolsSecurity –enable> in Terminal; and
put both Instruments.app and XCode in
System Preferences/Security & Privacy/Accessibility
without effect.
Is there a way to avoid this request for user/password but still have the slider change the number of cores?
-------------------------------
Any other suggestions for changing the number of cores at any given time, not just for a process but the complete computer, would be welcome?
-----
Imac, MacOS Mojave
Earlier Mac models