Messages in this thread | | | Date | Sat, 21 Jun 2008 18:38:24 +0200 | From | "Bart Van Assche" <> | Subject | Re: Any lightweight way for one thread to force another thread to suspend execution? |
| |
On Sat, Jun 21, 2008 at 1:54 AM, Eric Smith <eric@brouhaha.com> wrote: > Is there any method for one thread to force another thread to suspend > execution, then later let it resume, that is lighter weight than using > signals? I don't need it to be portable to anything other than Linux. > The suspend needs to be synchronous, but resume doesn't.
Trying to suspend another thread synchronously is a bad idea because this can easily trigger deadlocks. E.g. if you suspend a thread while that thread holds a lock on a mutex, your application will deadlock.
Bart.
| |