Redian新闻
>
pthread_kill SIGINT SIG_DFL multithread
avatar
pthread_kill SIGINT SIG_DFL multithread# Unix - 噫吁兮,危乎高哉
b*s
1
In a multithread task, sigset(SIGINT, SIG_DFL) is called. then one thread
sends SIGINT through pthread_kill() to the other thread.
Why the receiving thread is not terminated? Thanks a lot,
The receiving thread got EINTR if it is in read() system call since read()
returns -1.
What if recieving thread in an empty while loop.
avatar
y*p
2

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I experienced the same problem!! And the pthread_kill just terminated
the program when I send SIGTERM. if I use SIGKILL, pthread_kill kill.
The other thing I hate is that it doesn't give you any error!
I switch to pthread_cancel. It's said it's not a good way to use.
But at lease it seems to work for my hw.

【在 b*s 的大作中提到】
: In a multithread task, sigset(SIGINT, SIG_DFL) is called. then one thread
: sends SIGINT through pthread_kill() to the other thread.
: Why the receiving thread is not terminated? Thanks a lot,
: The receiving thread got EINTR if it is in read() system call since read()
: returns -1.
: What if recieving thread in an empty while loop.

avatar
y*p
3

I mean POSIX thread. pthread_kill seems to work for Solaris thread.

【在 y*****p 的大作中提到】
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: I experienced the same problem!! And the pthread_kill just terminated
: the program when I send SIGTERM. if I use SIGKILL, pthread_kill kill.
: The other thing I hate is that it doesn't give you any error!
: I switch to pthread_cancel. It's said it's not a good way to use.
: But at lease it seems to work for my hw.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。