LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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-20-2005, 07:35 AM   #1
enigma82
Member
 
Registered: Sep 2004
Location: Fagaras, Romania
Distribution: Mandrake 10.0
Posts: 48

Rep: Reputation: 15
Need FIFO thread scheduling policy


Hello,

I am posting on behalf of a friend (had a temporary problem with posting)!
Here is the post:


I've tried to write a C program to change the default thread scheduling policy from SCHED_OTHER to SCHED_FIFO. Though the program does not have any errors it doesn't seem to work. The threads execut in the same manner!
Can someoen help me with some advice or code sequence? Do I need a special real time linux kernel in order to do that?

I am using: RedHat 9.0 with the default kernel!
Here is the code that I am using at the moment:

<code>
pthread_t real;
pthread_attr_t realAttributes;
sched_param fifoLevel;
fifoLevel.sched_priority = (sched_get_priority_max(SCHED_FIFO) +
sched_get_priority_min(SCHED_FIFO)) / 2;

pthread_attr_init(&realAttributes);

pthread_attr_setschedpolicy(&realAttributes, SCHED_FIFO);
pthread_attr_setschedparam(&realAttributes, &fifoLevel);
pthread_create(&real, &realAttributes, realmain, NULL);
</code>


Regards,
 
  


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
How to set the password policy and lockout policy bin_shell Linux - Security 4 03-24-2010 03:30 PM
Samba System Policy, Default User Policy scooter549 Linux - General 2 02-24-2009 02:23 AM
Forum Policy - using [Solved] in thread titles Riddick LQ Suggestions & Feedback 6 10-01-2005 09:40 AM
scheduling thread gives error bndpatel Programming 1 06-24-2005 01:54 PM
snmptrapd FIFO eccsamba Linux - Networking 2 11-24-2004 08:52 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration