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] [day] [month] [year] [list]
Date:	Wed, 26 Aug 2009 12:32:51 -0400
From:	Bryan Donlan <bdonlan@...il.com>
To:	"Nikita V. Youshchenko" <yoush@...msu.su>
Cc:	linux-kernel@...r.kernel.org, Stas Bezzubtsev <stas@....cs.msu.su>
Subject: Re: Suspend one thread and resume another in one system call ?

On Wed, Aug 26, 2009 at 12:02 PM, Nikita V. Youshchenko<yoush@...msu.su> wrote:
> Hello.
>
> Consider a situation when:
> - there is a set of threads,
> - only one of those should be allowed to work at a time,
> - there are "switch moments" when one thread should suspend, and other
> (known) resume.
>
> "Classic" solutions like have each thread sleeping on a semaphore, and
> making switch operation "sem_post(next_sem); sem_wait(my_sem)" cause two
> syscalls per switch.
>
> Could anyone suggest a solution with only one kernel entry per switch -
> running thread enters kernel and is de-scheduled, new thread resumes and
> leaves kernel?
>
> Nikita
>
> P.S.
> Since there are other threads in the same application working in the
> parallel with the mentioned "exclusive set", user-space solutions like
> libpth are not interesting.

If these threads are truly exclusive, just use ucontext.h's
setcontext() to switch threads in userspace.
--
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