I have a code which I want to split up into multiple sub threads (limited). and I want the main thread to only return when all the sub threads have completed their execution