Subj : Re: thread suspend using pthreads? To : comp.programming.threads From : David Schwartz Date : Wed Aug 31 2005 11:13 am "threadnewbie" wrote in message news:1125484037.491015.114160@z14g2000cwz.googlegroups.com... > Is thread suspend supported by POSIX thread API? Yes, you can suspend threads any way you want provided you wrote the code for the thread that is being suspended. Otherwise, there is no safe way to do it. (What if the thread holds a critical lock?) > If not, what is the best way to implement this capability? It depends why you think you want to suspend a thread. People who ask how to suspend a thread are generally confusing how work is done with what work is done. > One way > seems to be sending SIGSTOP signal to the thread from another thread. SIGSTOP can't be caught or ignored, so how would you use it to stop a thread? You cannot alter the default behavior of SIGSTOP, which is to stop the process until SIGCONT is received. DS .