The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Nikita V. Youshchenko" <yoush@cs.msu.su>
To: linux-kernel@vger.kernel.org
Cc: Stas Bezzubtsev <stas@lvk.cs.msu.su>
Subject: Suspend one thread and resume another in one system call ?
Date: Wed, 26 Aug 2009 20:02:05 +0400	[thread overview]
Message-ID: <200908262002.06209@zigzag.lvk.cs.msu.su> (raw)

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.

             reply	other threads:[~2009-08-26 16:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26 16:02 Nikita V. Youshchenko [this message]
2009-08-26 16:32 ` Suspend one thread and resume another in one system call ? Bryan Donlan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200908262002.06209@zigzag.lvk.cs.msu.su \
    --to=yoush@cs.msu.su \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stas@lvk.cs.msu.su \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox