What is the java signal dispatcher thread?

后端 未结 2 1469
萌比男神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.

提交回复
热议问题