ch21 The main thread