Re: Ada Task Priorities (Windows vs Linux)



"AAFellow@xxxxxxxxxxx" <AAFellow@xxxxxxxxxxx> writes:

Hi Everyone,

How are tasks prioritized in Ada when running on Linux (compared to
Windows). I wrote a small test program that I ran in Windows, and it
seems that the higher the number that I set the task's priority to, the
higher the priority that is given to that task (I thought the opposite
was true?)

In Ada, higher numbers mean higher priority.

In Linux (using GNAT complier), how are the priorities mapped? I know
a lower number means a higher priority, with a range of -20 to 19 and a
default of 0. Do we just use these same numbers in the Ada code when
setting the priorities of the tasks?

No. You use the numbers in the range System.Priority
(or sometimes, System.Interrupt_Priority).
The default is System.Default_Priority.

Look at the source code for package System to see what the numbers are.

The Ada run-time system will map these numbers to whatever the operating
system uses. If the operating system thinks lower numbers mean higher
priority, then the Ada run-time system will take that into account.

Also, (so we can verify we have set the priorities correctly) does
Linux provide a way to actually see what priority the OS has given to
tasks that the Ada code has started? Are there any tools availible
that can do this?

I think the 'top' program will show such info. Not sure.

- Bob
.



Relevant Pages

  • Ada Task Priorities (Windows vs Linux)
    ... How are tasks prioritized in Ada when running on Linux (compared to ... I wrote a small test program that I ran in Windows, ... seems that the higher the number that I set the task's priority to, ... In Linux, ...
    (comp.lang.ada)
  • bug in Real-Time Preemption
    ... I have a test program which creates one thread with SCHED_RR and priority 50. ... Follows important parts from .config: ...
    (Linux-Kernel)
  • Re: Process timing issue
    ... it usually happens when the openssl speed test is started ( ... or when pagedaemon wakes up (I forgot to disable the swap and my test program ... as an interactive process, until the scheduler realizes it's not. ... resolution), and our program to real-time priority, we got rid of both problems. ...
    (freebsd-current)
  • Re: Process timing issue
    ... it usually happens when the openssl speed test is started ( ... or when pagedaemon wakes up (I forgot to disable the swap and my test program ... until the scheduler realizes it's not. ... resolution), and our program to real-time priority, we got rid of both problems. ...
    (freebsd-current)
  • Re: Process timing issue
    ... Using ktrdump and schedgraph.py and after modifying our test program to set and unset automatically debug.ktr.mask, I've been able to get useful information. ... I'm not sure why, but when we start openssl, it is often allowed to run for>= 300ms, even with our test program set to real time priority. ... My intuition is that, at first, it's considered as an interactive process, until the scheduler realizes it's not. ...
    (freebsd-current)