When I use threads in my code