Find the answer to your Linux question:
Results 1 to 3 of 3
Hi All, I have a timer thread, and when it expires, it sets a flag. The only problem is, if any higher priority thread comes in between, then the timer ...
  1. #1
    Just Joined!
    Join Date
    Dec 2010
    Posts
    34

    Question [SOLVED] Which is the scheduling algorithm which will make my thread o

    Hi All, I have a timer thread, and when it expires, it sets a flag. The only problem is, if any higher priority thread comes in between, then the timer is not expired in real time.

    Thus i want to set a highest priority to my thread. Now, i know 2 algos, which can make my thread in real time are: SCHED_FIFO and SCHED_RR.

    So, here are my queries: 1) Which scheduling algo is best suited for this purpose? 2) Is it guaranted to work in real time if i use that algo (you suggest in 1) and set the max_priority by getting the maximum settable priority for that particular algorithm using, int sched_get_priority_max(int policy);
    Thanks in advance

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    See the man page for sched_setscheduler for information about this. It does a reasonable job of explaining the options you have.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Dec 2010
    Posts
    34
    Quote Originally Posted by Rubberman View Post
    See the man page for sched_setscheduler for information about this. It does a reasonable job of explaining the options you have.
    Thank you Rubberman, i will get back to you if in case i get stuck somewhere

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...