Tuning multithreads