Questions tagged [blocked-threads]

38 questions
141
votes
6 answers

Difference between WAIT and BLOCKED thread states

What is the difference between thread state WAIT and thread state BLOCKED? The Thread.State documentation: Blocked A thread that is blocked waiting for a monitor lock is in this state. Waiting A thread that is waiting indefinitely for another…
More Than Five
  • 9,959
  • 21
  • 77
  • 127
22
votes
2 answers

what does WAIT_FOR_CONCURRENT_GC blocked mean?

I just did an automatic update from ICS (4.0.4) to JB (4.1) on my android phone and it introduced multiple garbage collection calls when I run my app: WAIT_FOR_CONCURRENT_GC blocked 30ms I'm streaming video in my app and these blocked GC calls are…
Dirk
  • 599
  • 1
  • 4
  • 18
17
votes
4 answers

Does Java blocked threads take up more CPU resources?

i would like to ask if Java will utilize more CPU resources when threads are blocked, i.e. waiting to lock a monitor which is currently being locked by another thread. I am now looking at a thread dump whereby some threads are blocked as they are…
Oh Chin Boon
  • 23,028
  • 51
  • 143
  • 215
15
votes
5 answers

Cancel blocking AcceptTcpClient call

As everyone may already know, the simplest way to accept incoming TCP connections in C# is by looping over TcpListener.AcceptTcpClient(). Additionally this way will block code execution until a connection is obtained. This is extremely limiting to a…
user1641096
  • 161
  • 1
  • 1
  • 4
11
votes
2 answers

what's different between the Blocked and Busy Waiting?

I known the implement of Busy Waiting. it's a death loop like this: //main thread while (true) { msg = msgQueue.next(); msg.runnable.run(); } //....msg queue public Message next() { while (true) { if (!queue.isEmpty()) { …
krosshj
  • 855
  • 2
  • 11
  • 25
10
votes
1 answer

Java ThreadPoolExecutor getting stuck while using ArrayBlockingQueue

I'm working on some application and using ThreadPoolExecutor for handling various tasks. ThreadPoolExecutor is getting stuck after some duration. To simulate this in a simpler environment, I've written a simple code where I'm able to simulate the…
Ravi Rao
  • 291
  • 1
  • 4
  • 12
7
votes
5 answers

Multiple threads stuck in native calls (Java)

I have a problem with an application running on Fedora Core 6 with JDK 1.5.0_08. After some amount of uptime (usually some days) threads begin getting stuck in native methods. The threads are locked in something like this: "pool-2-thread-2571"…
David Resnick
  • 4,891
  • 5
  • 38
  • 42
7
votes
2 answers

difference between Thread state blocked and waiting

I have read the answer through the following posting: Difference between WAIT and BLOCKED thread states However, I am still puzzled. I want to know what is the difference on the JVM level and what is the difference on the CPU level. Whether both of…
Timi
  • 892
  • 1
  • 8
  • 17
7
votes
2 answers

SelectorImpl is BLOCKED

I use a lot of client sends a request to the server about 1000 requests per second a client, the server's CPU soon rose to 600% (8 cores), and always maintain this state. When I use jstack printing process content, I found SelectorImpl is BLOCKED…
gdpencil
  • 83
  • 1
  • 6
6
votes
2 answers

How does I/O-methods like read() put a Thread in blocked state in java?

So, if i have understood this correctly, a thread goes into waiting state when we call wait on an object and it goes into blocked state when it is waiting for a lock on an object(like when trying to get into a synchronized block or method). How does…
Per Nissilä
  • 81
  • 2
  • 4
6
votes
6 answers

Java thread blocking

i have a problem with my java environement. I'm running Solr 1.3 (search engine) since more then a year now and suddenly i got alot of trouble with it. All my thread pool (250) got randomly blocked once or twice a day. I did not make any change on…
4
votes
3 answers

How is a thread in blocked state caused by waiting on a objects lock handled by the JVM

I have seen there are different ways a thread could get to blocked state. I'm interested to know what exactly happens after a thread is in blocked state. How does it get back to running state? If its blocked by sleep(time) then it moves to the…
RKy
  • 41
  • 1
  • 2
4
votes
3 answers

why is my PipedOutputStream deadlocking?

I am trying to implement a threaded circular buffer with PipedInputStream & PipedOutputStream but it is locking everytime when I get to mHead.write in the Decoder runnable. I thought there was no chance for deadlocks when using separate threads. …
Nathan Schwermann
  • 31,285
  • 16
  • 80
  • 91
3
votes
2 answers

How does Wait/Signal (semaphore) implementation pseudo-code "work"?

Wait(semaphore sem) { DISABLE_INTS sem.val-- if (sem.val < 0){ add thread to sem.L block(thread) } ENABLE_INTS Signal(semaphore sem){ DISABLE_INTS sem.val++ if (sem.val <= 0) { …
Sharat Chandra
  • 4,434
  • 7
  • 49
  • 66
3
votes
1 answer

Java blocked thread on String.toUpperCase()

One of the threads has a lock for more than 3 seconds when querying Oracle Database. This causes many blocked threads when accesing Oracle database, and hence sudden increases in number of threads and unresposiveness of application. Im am using…
1
2 3