Allow to specify the number of threads while scanning directories