Also make sure to join each thread after you're done to prevent any memory leaks etc. from threads that never get cleaned up.