java可以开启线程吗?
答案:
不可以;
原因:
java运行在虚拟机上,无法直接操作硬件,在start方法中调用了本地方法start0,通过C++操作
底层源码:
public synchronized void start() {
/**
* This method is not invoked for the main method thread or "system"
* group threads created/set up by the VM. Any new functionality added
* to this method in the future may have to also be added to the VM.
*
* A zero status value corresponds to state "NEW".
*/
if (threadStatus != 0)
throw new IllegalThread
java可以开启线程吗?最先出现在Python成神之路。
共有 0 条评论