10.2线程的生命周期 线程是程序内部的一个顺序控制流,它具有 个特定的生命周期。在一个线程的生命周期中, 它总处于某一种状态中。线程的状态表示了线程 正在进行的活动以及在这段时间内线程能完成的 任务
10.2 线程的生命周期 线程是程序内部的一个顺序控制流,它具有 一个特定的生命周期。在一个线程的生命周期中, 它总处于某一种状态中。线程的状态表示了线程 正在进行的活动以及在这段时间内线程能完成的 任务
10.2线程的生命周期 suspend sleep waIting waI sleeping ready new Thready running yield LI/流阻塞 suspending blocked start New Thread Runnable Not runnable stop runOexit resumed stop notify/notifyAlIO Dead stop VC指令
new Thread() New Thread Runnable start() Not Runnable stop() stop() Dead yield() stop() run()exit . . suspend() sleep() wait() I/O流阻塞 resume() notify()/notifyAll() I/O指令 . waiting sleeping suspending blocked ready running 10.2 线程的生命周期
10.2线程的生命周期 born start read wait interval expires notify quantum expiration dispatch JO complete fotifyAllo yield) interrupTa wait running is5把e珈 request ran complete waiting sleep blocked sleeping dead Sleep interval expires interrupt
born ready running waiting sleeping dead blocked start() quantum expiration dispatch yield() wait sleep() run complete issue I/O request wait interval expires notify() notifyAll() interrupt() I/O complete sleep interval expires interrupt() 10.2 线程的生命周期