lkml.org 
[lkml]   [2008]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: 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.


    \
     
     \ /
      Last update: 2008-06-21 18:41    [W:3.771 / U:0.340 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site