i am using multithreading in my program but im unable to know when all the threads have finished their tasks ... and when they return to the main program so i can display that the program is now ready to exit or task completed ... and also how can i synchronise the threads so that i may not get any write memory exceptions