title: Java Threads vs OS Threads
body: <p>Looks like I have messed up with Java Threads/OS Threads and Interpreted language.</p>
  
  <p>Before I begin, I do understand that Green Threads are Java Threads where the threading is taken care of by the JVM and the entire Java process runs only as a single OS Thread. Thereby on a multi processor system it is useless.</p>
  
  <p>Now my questions is. I have two Threads A and B. Each with 100 thousand lines of independent code. I run these threads in my Java Program on a multiprocessor system. Each Thread will be given a native OS Thread to RUN which can run on a different CPU but since Java is interpreted these threads will require to interact with the JVM again and again to convert the byte code to machine instructions ? Am I right ? If yes, than for smaller programs Java Threads wont be a big advantage ?</p>
  
  <p>Once the Hotspot compiles both these execution paths both can be as good as native Threads ? Am I right ?</p>
  
  <p>[EDIT] : An alternate question can be, assume you have a single Java Thread whose code is not JIT compiled, you create that Thread and start() it ? How does the OS Thread and JVM interact to run that Bytecode ?</p>
  
  <p>thanks</p>