Pádraig Brady wrote: > Pádraig Brady wrote: >> Giuseppe Scrivano wrote: >>> Hello, >>> >>> inspired by the attempt to make `sort' multi-threaded, I added threads >>> support to md5sum and the sha* programs family. It has effect only when >>> multiple files are specified. >>> >>> Any comment? >> >> How does it compare to: >> >> files_per_process=10 >> cpus=4 >> find files | xargs -n$files_per_process -P$cpus md5sum >> >> I would expect it to be a bit better as file_per_process >> could be very large, thus having less overhead in starting >> processes. Though is the benefit worth the extra implementation >> complexity and new less general interface for users? > > Hi James, > > I was wondering would it be worth adding the nproc module to xargs > to support -P without any options to use the number of CPUs > as the value. > > Hmm, I could see it being useful to specify NCPUs-1 also. > I wonder is there a general external method to determine > the number of CPUs.
As far as I know, there is nothing portable. Want to add another program to coreutils? With what Bruno has just added to gnulib's nproc module, we should have most platforms covered.