由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - pthread_kill SIGINT SIG_DFL multithread
相关主题
multithread questionHelp wanted for CURSES
multithread programmingfile descriptor
Help please! 怎么keep当前还在运行的child process[转载] alarm, pause 又一问
Does Linux support thread?A Unix question
what is the difference between pthread and thr_ ?does Linux has real time timer?
openMP or boost::thread (pthread) for multithreading ?which shell is the best among csh, ksh, bsh?
[转载] Re: 如何屏蔽掉CTRL-Z(UNIX的TERMINAL) 急Perl Q
what does command 'kill -HUP' meansasync-signal safe 问题
相关话题的讨论汇总
话题: pthread话题: sigint话题: thread话题: kill话题: dfl
进入Unix版参与讨论
1 (共1页)
b*s
发帖数: 1
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.
y*****p
发帖数: 733
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.

y*****p
发帖数: 733
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.

1 (共1页)
进入Unix版参与讨论
相关主题
async-signal safe 问题what is the difference between pthread and thr_ ?
Socket programming helpopenMP or boost::thread (pthread) for multithreading ?
a perl question[转载] Re: 如何屏蔽掉CTRL-Z(UNIX的TERMINAL) 急
多次遇到这种问题:previous declaration of .....what does command 'kill -HUP' means
multithread questionHelp wanted for CURSES
multithread programmingfile descriptor
Help please! 怎么keep当前还在运行的child process[转载] alarm, pause 又一问
Does Linux support thread?A Unix question
相关话题的讨论汇总
话题: pthread话题: sigint话题: thread话题: kill话题: dfl