Questions tagged [thread-state]

Thread state describes state of thread in given time.

Thread can have one of states at the time.

States are implementation/platform dependent, but basically all of this states are implemented on most platforms:

  • NEW A Fresh thread that has not yet started to execute.

  • RUNNABLE A thread that is executing in the Java virtual machine.

  • BLOCKED A thread that is blocked waiting for a monitor lock.

  • WAITING A thread that is wating to be notified by another thread.

  • TIMED_WAITING A thread that is wating to be notified by another thread for a specific amount of time.

  • TERMINATED A thread whos run method has ended.

39 questions
0
votes
0 answers

When does a thread in park state resumes enters into execution state?

Say a server is capable of handling 8 concurrent connections at a time and it is allowed to have 100 connections to be in the pool the when a thread enters now and it is not allowed to enter into execution thread pool (here it is 8) also there is no…
user7946343
0
votes
1 answer

How to get the interrupted status of a terminated Java Thread?

I'm trying to determine if a Java Thread was interrupted or not at the time that it terminated. So far the answer seems to be "no"... Right before falling off the end of run() we can see Thread.currentThread().isInterrupted() is true. But after…
0
votes
1 answer

Can a running thread become runnable on entering a uncontested synchronized block?

There is a strange thing happening on our production box. Code functionality: A UI servlet takes a monitor lock on the document object which is being actioned upon by the user and performs some computation on it. The monitor lock is acquired to…
RGJ
  • 11
  • 2
0
votes
2 answers

IllegalThreadStateException on Thread.interrupt

I have a java program, which takes very long time to compile. For testing purposes, I want to kill the program and restart it if compilation takes long duration. Here is the simplified version of my code: public class Main { public static…
nloomans
  • 220
  • 2
  • 11
0
votes
0 answers

Threadstateexception in release, but not debug

I get threadstateexception was unhandled whenever I try to open a file dialogue. I only get it when running Visual studio(2012) with Release setting, when I change back to Debug everything seems to work as intended. The application crashed on the…
Fousk
  • 31
  • 4
0
votes
1 answer

Why does a NPE cause JVM to Crash?

We're using Struts2 for an enterprise application and it crashes because of a NPE. The exception occures in the error handling method of the action. My guess is, it's trying to call the error handling method recursively because when it's trying to…
Emre Türkiş
  • 992
  • 9
  • 23
0
votes
4 answers

ThreadStateException occures when trying to start a process

I am trying to run my recursive function "hueckel_operator()" in another thread whose stack size is increased to 10.000.000. Firstly, hueckel_operator is called when I click on detect edges button. So I have created new thread in…
mctuna
  • 809
  • 3
  • 19
  • 38
0
votes
2 answers

how to know state of the thread while debugging core dump with gdb on linux?

i am getting crash in the thread. while debugging coredump with gdb, i want to see the state of the thread just before crash. in my program i am raising a signal for that thread and handling it. it would be helpful to know the state before the…
sandeep
  • 513
  • 9
  • 17
-1
votes
2 answers

ThreadState always is "Unstarted"

When I start a thread, the ThreadState always is "Unstarted" even if I do a "Thread.Abort()", my thread starts and finish the work good... I don't know why I get that always the same state. Dim thread_1 As System.Threading.Thread = New…
1 2
3