Parallelizing recursion in a for-loop using readdir
问题 I'd like to parallelize a C-program which recursively calculates the size of a directory and its sub-directories, using OpenMP and C. My issue is, that when I get into a directory using opendir , and I iterate through the sub-directories using readdir I can only access them one by one until I've reached the last sub-directory. It all works well sequentially. When parallelizing the program, however, I think it would make sense to split the number of sub-directories in half (or even smaller