Re: Any lightweight way for one thread to force another thread to suspend execution?

From: Bart Van Assche
Date: Sat Jun 21 2008 - 12:38:47 EST


On Sat, Jun 21, 2008 at 1:54 AM, Eric Smith <eric@xxxxxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/