53

面试官: 说说看什么是 Hook (钩子) 线程以及应用场景?-Java小泽的博客

 5 years ago
source link: https://blog.51cto.com/14257804/2379579
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Hook 线程只有在正确接收到退出信号时,才能被正确执行,如果你是通过 kill -9这种方式,强制杀死的进程,那么抱歉,进程是不会去执行 Hook 线程的,为什么呢?你想啊,它自己都被强制干掉了,哪里还管的上别人呢?请不要在 Hook 线程中执行一些耗时的操作,这样会导致程序长时间不能退出。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK