LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-24-2007, 04:12 AM   #1
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Rep: Reputation: 41
Question How to set priority of sched_param?


Hello everyone! I can't seem to set the realtime priority of a certain task using via the sched_param struct. I need to do it that way so that when my sched_param struct has a priority, I can now place it as argument in the sched_setscheduler() function. My assignment statement to increase the priority by 10 is:

struct sched_param param;
param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 10;

but this has no effect, like when I try to print the priority using this:
static int prio;
prio = getpriority(PRIO_PROCESS, 2174);

The value of prio is 0. 2174 is the pid of the process. Is there other way to initialize the value of sched_param?

Thanks!

Last edited by archieval; 04-24-2007 at 04:32 AM.
 
Old 04-24-2007, 04:36 AM   #2
v.tieubao
LQ Newbie
 
Registered: May 2006
Posts: 7

Rep: Reputation: 0
Code:
man setpriority
Cheers,
VTB
 
Old 04-24-2007, 06:13 AM   #3
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Original Poster
Rep: Reputation: 41
I need to place the value in the sched_setscheduler(), which needs an argument sched_param. So I need to know how to set sched_param.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
process priority,nice -- small question regarding high/low priority values beeblequix Linux - Newbie 1 10-11-2006 11:22 AM
Allow User to Set Priority 321 Linux - General 4 07-24-2006 02:16 AM
How to set IRQ 4(Serial Modem) as top priority in Linux? Balarabay1 Programming 0 05-03-2006 09:45 AM
priority alaios Linux - General 3 10-12-2004 07:55 AM
how do i set processor priority? Chooco Linux - General 2 06-11-2002 11:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:58 AM.

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