五种线程状态的精确定义

摘自《深入理解Java虚拟机》周志明著

1. New: 创建后尚未启动

2. Runnable: Running(正在执行) 或
Ready(正在等待分配时间片)

3. Waiting: 不会分配CPU时间,直到被唤醒进入Runnable

4. Timed Waiting: 不会分配CPU时间片,直到被唤醒,或者Time Up

5. Blocked: 在等待一个排它锁,等拿到锁了就进入Runnable

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.