mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: maxime louvel <m.louvel@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: suspend a thread with an another thread
Date: Fri, 18 Sep 2009 08:53:03 +0200	[thread overview]
Message-ID: <dda529d0909172353u6ec2c59ele6467617078f726d@mail.gmail.com> (raw)

HI all,

I'm doing a phd related to QoS and resources management within
distributed systems.
I would like to affect a CPU budget to my applications, one
application being a thread.

As I would like to experiment quickly my ideas in order to test them,
I wanted to use a little trick :
instead of modifying the linux scheduler (which I guess will take me a
lot of time because I'm not familiar with it) I tried to use a "super
thread".

My try was that this "super thread" with higher priority is suspending
the other threads if they overcome their cpu budget.
I thought of something like activate an application thread, make the
super thread sleep for X time (cpu budget) and then wake up and
suspend the application thread until next time.

However I haven't been able to do that because I've read (and test
myself :) ) that :
- it is not possible to suspend a thread by an another thread (I don't
think I can use the pthread_cond facilities)
- as threads within a process share the signals and signal handlers I
can't send a signal (like SIGUSR1 or SIGSTOP) to a specific thread.
Correct me if I'm wrong

Is there a way I can do what I want ?

Or should I start by looking at how to modify the linux scheduler ?

thanks a lot,

Maxim

--
Maxime Louvel
+33 6 85 91 05 30
3 rue charreton
38000 Grenoble
France

             reply	other threads:[~2009-09-18  6:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18  6:53 maxime louvel [this message]
2009-09-18  7:29 ` Peter Zijlstra

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=dda529d0909172353u6ec2c59ele6467617078f726d@mail.gmail.com \
    --to=m.louvel@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®