What is the best way to make two threads do things alternatively? Thanks.