Hello,
I would like to ask for threads in Java. As we know, JVM uses system threads (native threads). So, for example it uses Linux threads. In simplification a thread is a stack + piece of code to execute.
Let's consider:
Thread t = new Thread(() -> {`any_code`});
t.start();
t.join();
`any_code` will be compile to bytecode. So, how does the t is executed? We can assume that that code wouldn't be jited. I cannot understand what is a "content" of that thread? After all, bytecode must be interpreted
by JVM. So, does the thread execute a JVM that interprets a bytecode `any_code`?
Hello,I would like to ask for threads in Java. As we know, JVM uses system threads (native threads). So, for example it uses Linux threads. In simplification a thread is a stack + piece of code to execute.Let's consider:
Thread t = new Thread(() -> {`any_code`});
t.start();
t.join();
`any_code` will be compile to bytecode. So, how the thread is executed? We can assume that that code wouldn't be jited. I cannot understand what is a content of that thread? After all, bytecode must be interpreted
by JVM. So, does the thread execute a JVM that interprets a bytecode `any_code`?
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
De: "John Hening" <goci...@gmail.com>
À: "mechanical-sympathy" <mechanica...@googlegroups.com>
Envoyé: Lundi 13 Novembre 2017 00:17:32
Objet: Executing thread by JVM.
Hello,I would like to ask for threads in Java. As we know, JVM uses system threads (native threads). So, for example it uses Linux threads. In simplification a thread is a stack + piece of code to execute.
Let's consider:
Thread t = new Thread(() -> {`any_code`});
t.start();
t.join();`any_code` will be compile to bytecode.
So, how the thread is executed?
We can assume that that code wouldn't be jited.
I cannot understand what is a content of that thread? After all, bytecode must be interpreted
by JVM. So, does the thread execute a JVM that interprets a bytecode `any_code`?
"does the thread execute a JVM" -> this implies forking a new process, perhaps unintentionally, but for clarity the JVM does not spawn a new process per thread.