Do you mean P states? C states are sleep states that only get used when a core has no work to do. Or do you need low wakeup latency for a workload that doesn't occupy all cores all the time, and need to stop cores from sleeping as deeply? (At the expense of not having as much thermal headroom to turbo as high when your code is running, potentially.) You can set governors, like governor = performance and/or echo performance | sudo tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference to encourage HW P-state management to be aggressive, not running at idle clocks.
@PeterCordes Yes I probably meant P states. I know the OS should be tuned but I like this being controlled by the code. I have some threads which run at 100% cpu and I wanted to make sure the CPU is at it's fastest performance settings.
@BoP: Unless the purpose of the application was to benchmark things at different CPU frequencies. Or possibly as optional behaviour of an application, not on by default, if typical system behaviour is known to cause problems for some users, like perhaps stuttering or dropouts in a low-latency real-time audio/video processing application or something. (Although I don't think there are any per-process power-management things except maybe some cgroups stuff?) For anything else, hell no. Document some system-wide config recommendations for root, but don't try to do it from within the program.
echo performance | sudo tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preferenceto encourage HW P-state management to be aggressive, not running at idle clocks.