LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-18-2009, 07:35 AM   #1
icoming
Member
 
Registered: Feb 2004
Posts: 96

Rep: Reputation: 15
which value is for highest priority for real-time processes


Hi,

I want to set my program with highest priority for real-time processes. I understand the priority for real-time processes ranges from 1-99, but I get completely confused after reading Understanding the Linux Kernel and the manual of sched_get_priority_max(): which value has higher priority? either 1 or 99. Understanding the Linux Kernel says 1 has highest priority but sched_get_priority_max() returns 99 for SCHED_FIFO and SCHED_RR policy.

Could anyone please tell me which one is right?

Thank you,
Zheng Da
 
Old 12-19-2009, 05:40 PM   #2
conconga
LQ Newbie
 
Registered: Dec 2009
Posts: 22

Rep: Reputation: 1
Quote:
Originally Posted by icoming View Post
Hi,

I want to set my program with highest priority for real-time processes. I understand the priority for real-time processes ranges from 1-99, but I get completely confused after reading Understanding the Linux Kernel and the manual of sched_get_priority_max(): which value has higher priority? either 1 or 99. Understanding the Linux Kernel says 1 has highest priority but sched_get_priority_max() returns 99 for SCHED_FIFO and SCHED_RR policy.

Could anyone please tell me which one is right?

Thank you,
Zheng Da
You will never get "real" real-time, with determinism and all things included in its definition using normal linux kernel.
 
Old 12-19-2009, 08:40 PM   #3
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
use the nice command. this can alter a commands priority.
Code:
nice --5 <command>
Look through the documentation because using this command incorrectly and bring your system to a crawl as all processing power could potentially be used on this one process.

edit: oops just reread your post. Sorry that probably won't help you.


I believe that closer to a negative value yeilds a higher priority.

Last edited by jstephens84; 12-19-2009 at 08:44 PM.
 
Old 12-19-2009, 10:30 PM   #4
icoming
Member
 
Registered: Feb 2004
Posts: 96

Original Poster
Rep: Reputation: 15
I don't really need "real" real-time. What I want is to run my program with the highest priority thus it can occupy the whole CPU time. Using nice() cannot make a program with real-time priority though it can get higher priority.

If my system doesn't contain any processes with real-time priority, it's probably ok to use any real-time priority. But what surprises me is that when I run my program with the priority 99 and run a compiler, my program is noticeably slower. Note: I measure the elapsed time after the process uses real-time priority. I think there wasn't any error when changing the priority.

So can using the priority 99 fulfill my requirement (see above)?

Thank you,
Zheng Da
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Real time processes mircan Linux - General 8 02-12-2010 07:29 AM
real time kernel not real time, still xruns in Jackd browny_amiga Linux - General 0 09-20-2009 02:47 PM
LXer: Real-time garbage collection with Real-time Java LXer Syndicated Linux News 0 05-05-2007 12:16 PM
LXer: Real-time Linux gains real-time JVM LXer Syndicated Linux News 0 10-12-2006 10:54 AM
Assigning highest priority to process. gangaraju Fedora 3 02-07-2006 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration