[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

Threads and Java Interpreter state

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,  
0
jjescri
Asked:
jjescri
1 Solution
 
remboCommented:


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


0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now