vasi / pixz

Parallel, indexed xz compressor
BSD 2-Clause "Simplified" License
711 stars 61 forks source link

Only use available CPUs #107

Closed wsldankers closed 2 years ago

wsldankers commented 2 years ago

Not all online CPUs may be available for the current process, especially when CPU affinity is involved. In such cases too many threads will be created, which will unnecessarily compete for CPU time.

Use sched_getaffinity() (if available) to determine the correct number of threads to create.