views:

1345

answers:

2

I was looking through a thread dump of a java process, and notice some threads blocked by signal dispatcher.

What is signal dispatcher? What does it do?

+2  A: 

I found an article about this on IBM developerWorks. When the OS raises a signal to the JVM, the signal dispatcher thread will pass the signal to the appropriate handler

Revelations on Java signal handling and termination by Chris White, Software Engineer, IBM

Eric Weilnau
+1  A: 

OS Signals are inherently single-threaded, so it's important that they are all handled on the same thread. So, a dispatcher is a natural way to achieve this. Think of it like the single GUI event thread for AWT.

On a tangential note, if you are Linux and your JVM loads a native library that inserts its own signal handlers, then you will need to preload libjsig.so. I found out the hard way when a third-party networking library intermittently tore down my connections with misdirected sigpipes.

Chris Dolan