Threads and Java Interpreter state

jjescri
jjescri used Ask the Experts™
on
Hello,
I have a doubt regarding threads. Suppose a Java program runs two threads. One of them gets blocked, e.g. awaiting a TCP packet, while the other one goes on running. After a while the Java Interpreter is removed from the CPU. Which is then the state of the Java Interpreter, since it has a blocked thread and a runable one. Is the interpreter blocked or runable. Please, a detailed explanation is required.
Thanks,  
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:


The process is runnable.  The way that threads work in
this instance is that the thread is not its own process,
therefore according to the operating system, the virtual
machine, which is its own process is not blocked.  

It is up to the threaded process to manage its own state
of affairs.  This means that part of the saved state of
the process when the VM is preempted by the operating
system, is the perceived state of its thread.

-Tony


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial