COMP: restructure code so that the filename generator thread
doesn't stay tied up in the directory traversal code