java的接口runnable# Java - 爪哇娇娃
e*m
1 楼
一直搞得不是很清楚,不知道前人问过没有。 java内实现多线程的时候可以通过实现
借口runnable, 既然runnable是接口,没有任何的内部机制,怎么实现的多线程? 难
道是jvm运行的时候,碰到实现runnable的对象就当成多线程的程序来处理,实际上最
终的多线程的实现是在jvm中实现的,而不是在设计对象的时候实现的。
如果用c++来实现多线程,因为语言本身不支持,就必须自己设计的对象亲自处理多线
程运行的各种情况了吧? 有没有现成的c++类库已经实现了多线程了?
欢迎各位大师的指导。
借口runnable, 既然runnable是接口,没有任何的内部机制,怎么实现的多线程? 难
道是jvm运行的时候,碰到实现runnable的对象就当成多线程的程序来处理,实际上最
终的多线程的实现是在jvm中实现的,而不是在设计对象的时候实现的。
如果用c++来实现多线程,因为语言本身不支持,就必须自己设计的对象亲自处理多线
程运行的各种情况了吧? 有没有现成的c++类库已经实现了多线程了?
欢迎各位大师的指导。