Program that switches back and forth between threads.