When my multithreaded program works like a charm