Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Q: Threads and priority
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Cédric Pillonel  
View profile  
 More options Oct 7 2003, 2:22 am
Newsgroups: comp.os.linux.development, comp.os.linux.development.apps, comp.os.linux.development.system
From: "Cédric Pillonel" <cedric.pillo...@swisscom.com>
Date: Tue, 7 Oct 2003 08:22:28 +0200
Local: Tues, Oct 7 2003 2:22 am
Subject: Q: Threads and priority
If the scheduling policy is SCHED_RR priorities of thread can only be
changed by the superuser. If the policy is SCHED_OTHER ony the superuser can
raise the priority. Users without superuser priviledges can only lower the
priorities of threads.

I want to run my application as a normal user (not superuser) but I want to
raise the priority of one of my threads (real-time priority = SCHED_RR). Is
it possible?

Thank you.
Cédric Pillonel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nils O. Selåsdal  
View profile  
 More options Oct 7 2003, 2:47 am
Newsgroups: comp.os.linux.development, comp.os.linux.development.apps, comp.os.linux.development.system
Followup-To: comp.os.linux.development.apps
From: nosel...@frisurf.no (Nils O. Selåsdal)
Date: Tue, 07 Oct 2003 06:47:08 GMT
Local: Tues, Oct 7 2003 2:47 am
Subject: Re: Q: Threads and priority
In article <1065507748.426242@ftpgate>, Cédric Pillonel wrote:
> If the scheduling policy is SCHED_RR priorities of thread can only be
> changed by the superuser. If the policy is SCHED_OTHER ony the superuser can
> raise the priority. Users without superuser priviledges can only lower the
> priorities of threads.

> I want to run my application as a normal user (not superuser) but I want to
> raise the priority of one of my threads (real-time priority = SCHED_RR). Is
> it possible?

You'd have to start the program as root(e.g. setuid root) set the scheduler,
and drop privilegies with seteuid() and similar. Just note that the realtime
scheduler can bite you. One little error and your machine might appear
locked. I'd say you should rather use nice(2).

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mikko Rauhala  
View profile  
 More options Oct 7 2003, 2:57 am
Newsgroups: comp.os.linux.development, comp.os.linux.development.apps, comp.os.linux.development.system
Followup-To: comp.os.linux.development.apps
From: Mikko Rauhala <m...@iki.fi>
Date: 7 Oct 2003 06:57:04 GMT
Local: Tues, Oct 7 2003 2:57 am
Subject: Re: Q: Threads and priority
On Tue, 7 Oct 2003 08:22:28 +0200, Cédric Pillonel

 <cedric.pillo...@swisscom.com> wrote:
> I want to run my application as a normal user (not superuser) but I want to
> raise the priority of one of my threads (real-time priority = SCHED_RR). Is
> it possible?

You need to do one of two things:

1) Make the program setuid root, have it set RR scheduling and immediately
drop root priviledges. Alternatively, make a suid root wrapper that starts
the actual program with normal user priviledges and gives it SCHED_RR from
outside.

2) Arrange for the program to have the CAP_SYS_NICE capability; no root
needed at runtime. In practice you could probably do this e.g. through
the use of a suid root wrapper executable ;P (I don't think there's
official filesystem support for capabilities yet; patches maybe, dunno.)

--
Mikko Rauhala   - m...@iki.fi     - <URL:http://www.iki.fi/mjr/>
Transhumanist   - WTA member     - <URL:http://www.transhumanism.org/>
Singularitarian - SIAI supporter - <URL:http://www.singinst.org/>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »