Default behavior for what you describe:
- An OS thread is created, and tied to a new Thread object. Your code is
the "Runnable" for that Thread
- When the thread is started a bunch of JVM runtime code is executed,
finally calling into Thread::run, which in turn calls into your code.
- Your code is
Hey John,
Without commenting on whether threads in Java are always tied to native
threads (I don't think this is always strictly true), sounds like there
might be a misunderstanding here. What is special about threads in
particular that make you think `any_code` wouldn't be JIT-able here? Put
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();