Separate number of directories from parallel threads