• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stuck Thread in RUNNABLE state

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We observed this stuck thread in Production server. This is the second time I see something like this: A stuck thread with RUNNABLE state. I can't understand how that can happen.

The server is WebLogic server 10.3 running on Sun JVM.

Has anyone encountered a similar situation? Please share your finding. Many thanks in advance.

 
author
Posts: 23956
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Don't know if this is related, but you may want to synchronize that hashmap -- use Collections.syncrhonziedMap() on it.

https://coderanch.com/t/528711/threads/java/Hung-threads-caused-HashMap-dom

I have never seen it stuck in the put() method before, but as described in the other topic, I have seen it stuck in the get() method.

Henry
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, the stuck thread issue in relation to java.util.HashMap did ring a bell here too.
There's a blog post somewhere that describes the race condition in its internal resize logic beautifully.
I'll try to find it.
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here we go: http://mailinator.blogspot.nl/2009/06/beautiful-race-condition.html
So the long and short of it is: HashMap is not and was never intended to be a thread-safe collection, so if you manipulate it from mulitple threads without proper synchronization, all bets are off.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic