On Fri, 2013-05-31 at 14:24 +0800, Xin Wang wrote: > > > Thank you for pointing out this. > > > After some more search, I found that pthread has function pthread_kill > [1], which can be used to send signal to specific thread. > > > No sure if it can be used to implement similar behaviour. > > > [1] > http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_kill.html
At least in Linux, pthread_kill may effect the whole process: ----------------------------cut---------------------------------- Signal dispositions are process-wide: if a signal handler is installed, the handler will be invoked in the thread thread, but if the disposition of the signal is "stop", "continue", or "terminate", this action will affect the whole process. ----------------------------end---------------------------------- The real solution for your purpose is green-thread IMO. > > > > Regards, > > Xin Wang > > > >