lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57001.64.62.206.10.1214255297.squirrel@ruckus.brouhaha.com>
Date:	Mon, 23 Jun 2008 14:08:17 -0700 (PDT)
From:	"Eric Smith" <eric@...uhaha.com>
To:	"Andi Kleen" <andi@...stfloor.org>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: Any lightweight way for one thread to force another thread to  
     suspend execution?

Andi wrote about my inquire regarding a way to synchronously stop
another thread:
> Any such mechanism will need a syscall, and it's unlikely that
> any syscall will get much cheaper than a kill(SIGSTOP)

Unfortunately, as Bart pointed out, this stops ALL the threads
in a process (required for POSIX conformance).  However, it appears that
I may be able to do it by creating my threads using clone() with appropriate
parameters rather than pthread_create().

The next question, which I haven't yet been able to answer for myself
from staring at the kernel sources, is whether sending SIGSTOP is
synchronous.  In other words, when the kill() returns, is the target
thread already stopped?  Even on an SMP system where the thread may have
been executing concurrently on another processor?

If not, the next question will be whether there's a more efficient way
to wait for a process to enter the "T" state than busy-polling a file
in /proc.

Thanks,
Eric

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ