lkml.org 
[lkml]   [2008]   [Jun]   [22]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSun, 22 Jun 2008 11:14:56 +0200 (CEST)
FromJan Engelhardt <>
SubjectRe: Any lightweight way for one thread to force another thread to suspend execution?
On Sunday 2008-06-22 03:55, Eric Smith wrote:
>Andi wrote:
>> Any such mechanism will need a syscall, and it's unlikely that
>> any syscall will get much cheaper than a kill(SIGSTOP)
>
>But is there a way for the process sending the SIGSTOP to wait until it
>has taken effect?  I need a method to *synchronously* stop another
>thread.  That's why I thought I probably needed something more
>elaborate than SIGSTOP, though I'd like to minimize the number of
>system calls required.

When it is stopped, the process state changes to "T" (in ps and /proc).
Note that debugging a program with gdb or ptrace also puts it in the T state.


\
 
 \ /
  Last update: 2008-06-22 11:17    [from the cache]
©2003-2008