What is the java signal dispatcher thread?

后端 未结 2 1470
萌比男神i
萌比男神i 2021-01-02 03:57

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条回答
  • 2021-01-02 04:29

    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.

    0 讨论(0)
  • 2021-01-02 04:39

    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

    0 讨论(0)
提交回复
热议问题