簡體   English   中英

有什么方法可以將信號從另一個進程發送到線程嗎?

[英]Is there any way to send signal to a thread from another process?

我想將信號從一個進程發送到另一個進程 (尚未創建該線程)創建的線程。

我對此的了解是:

  • 提高 :將信號發送到同一進程

  • pthread_kill可以從同一進程(即創建該線程的進程)向線程發送信號。 您不能使用pthread_kill從另一個進程向線程發送信號。

  • 殺死發送信號到進程

有什么方法可以將信號從另一個進程發送到線程嗎?

希望我清楚! 注意:我是不熟悉Unix和線程技術的

您應該閱讀有關

  1. pthread_signal()

應該為您設定正確的方向

有一個適當命名的tkill(2)

 tkill, tgkill - send a signal to a thread tgkill() sends the signal sig to the thread with the thread ID tid 

您可以使用gettid(2)


當心:TID的概念,因此與TID有關的一切都是特定於Linux的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM