Subj : Re: Windows Suspend/ResumeThread API equivalent for Linux or POSIX? To : comp.programming.threads From : David Schwartz Date : Wed May 11 2005 01:10 pm "Chris Thomasson" <_no_damn_spam_cristom@_no_damn_comcast.net_spam> wrote in message news:DaednQpM4cnzPBzfRVn-pA@comcast.com... >> Why do you think you need to suspend a thread? > In order to call the Windows GetThreadContext Thread API, you need to use > the Resume/SuspendThread API. I am reading thread context and comparing > against deferred pointers in a modified SMR polling algorithm; You can > eliminate the hazard pointer reload and compare by doing this. Sounds like doing an awful lot of work to save a small amount of work. Suspending a thread without its cooperation is an incredibly expensive thing to do. > I was wondering if Linux and/or POSIX has a way to get thread context and > if it was similar to the way windows does it. Something like: > > pthread_suspend_np( pthread_t, ucontext_t* ); > pthread_resume_np( pthread_t ); No. What could you do while the thread was suspended? How can you be sure you don't trip over a lock the suspended thread holds? DS .