开发者

How JVM use operating system when creation of thread?

Here i try to learn java thread clearlly.. On which process JVM create the thread. Suppose if i create a thread in java then how JVM create this th开发者_高级运维read? To whom it will send to exicute?.. Which one is the base process for this...


Most JVMs use standard OS calls to create native threads (eg, the Win32 CreateThread API, or POSIX pthread_create), and pass a native function within the JVM which proceeds to execute the Java code in the thread.


There is a separate JVM process for every running Java application. The threads that the application creates are created within that process.


Actually the Java Virtual Machine Specification does not specify how threads are to be handled by a JVM. There is only a high level description. The Sun JVM itself made a change in this regard: Up to Java 1.1 it used so called Green Threads that are managed by the JVM itself. Later it used native threads that the host operating system provides.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜