开发者

pthreads signal a specific thread

开发者 https://www.devze.com 2023-02-16 15:16 出处:网络
In pthreads, is it possible for a thread to wake up another thread given only the other thread\'s id?

In pthreads, is it possible for a thread to wake up another thread given only the other thread's id?

(Kind of like, calling pthread_cond_signal() but with also a specific开发者_如何学编程, known, thread id in mind)


You may try using sigaction() and pthread_kill().


See the discussion between @Sam Hocevar and myself in response to this question; the documentation says pthread_kill(3) delivers a signal to a specific thread, and I'm less sure about the Linux implementation sticking true to this requirement.

0

精彩评论

暂无评论...
验证码 换一张
取 消