Is it safe when using the Python Concurrent Futures to use ALL the vCores available in the machine?
My code currently uses the vCores available minus 1 as I want to leave one vCore “free” for the system, to avoid freezing the system. I am wonder if this approach is silly and if the concurrent futures manages somehow manages this.
def get_cpu_cores():
"""
Get the number of CPU cores minus one.
Returns:
int: Optimal number of threads.
"""
cpu_count = multiprocessing.cpu_count()
return max(1, cpu_count - 1)
1