gpt4 book ai didi

java - 运行是线程的一种状态吗?

转载 作者:行者123 更新时间:2023-12-02 13:15:34 24 4
gpt4 key购买 nike

我在浏览java文档时发现运行并不是线程的一种状态。但我在网上发现一些文章说运行是一种状态。那么java中是否运行线程状态呢?

引用: https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.State.html

最佳答案

是的,RUNNABLE是线程运行时的状态。

来自您链接的javadoc:

A thread state. A thread can be in one of the following states:

RUNNABLE
A thread executing in the Java virtual machine is in this state.

javadoc 中有关 RUNNABLE 的注释:

A thread in the runnable state is executing in the Java virtual machine but it may be waiting for other resources from the operating system such as processor.

关于java - 运行是线程的一种状态吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43778770/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com