It's one of the possible solutions, but it's not optimal because thread creation is cost operation.
You can process files in a loop inside a thread.