RTEMS POSIX Priority Inversion Issue.

JunBeom Kim (EmbedCoreTech) jbkim at e-coretech.kr
Fri Dec 28 06:45:34 UTC 2018


Dear Sir,

 

I am testing RTEMS POSIX thread priority.

I am still using RTEMS 4.12 in 2017 year.

 

There are four pthreads(main, pthread1, pthread2, pthread3) on two cores in
my test case.

- main pthread is running on core 1.

- pthread1, pthread2, pthread3 is running on core 2.

- All threads are doing GPIO toggling action in while(1) loop.

- my configuration for timeslice quantum is 25ms.

 

As I know from RTEMS POSIX manual, there is below statement.

 

In the RTEMS implementation of the POSIX API, the priorities range from the
low priority of

sched_get_priority_min() to the highest priority of
sched_get_priority_max(). Numerically

higher values represent higher priorities.

 

But, when I test this, lower value is doing as higher priority. Higher value
is doing as lower priority.

Is this correct operation ?

 

Case 0) All threads are same priority.

[/] # pthread

ID       NAME             CPU SHED PRI STATE  MODES    EVENTS WAITINFO

----------------------------------------------------------------------------
--

0b010001  main_thread       1 MEDF 2147483645 READY P:T:nA   NONE   

0b010002  pthread1           2 MEDF 2147483645 READY P:T:nA   NONE   

0b010003  pthread2           2 MEDF 2147483645 READY P:T:nA   NONE   

0b010004  pthread3           2 MEDF 2147483645 READY P:T:nA   NONE



 

Case 1) pthread3 is lower priority according to manual. But, pthread3 is
higher priority in my case.

[/] # pthread

ID       NAME             CPU SHED PRI STATE  MODES    EVENTS WAITINFO

----------------------------------------------------------------------------
--

0b010001  main_thread       1 MEDF 2147483645 READY P:T:nA   NONE   

0b010002  pthread1           2 MEDF 2147483646 READY P:T:nA   NONE   

0b010003  pthread2           2 MEDF 2147483646 READY P:T:nA   NONE   

0b010004  pthread3           2 MEDF 1789569706 READY P:T:nA   NONE



 

Case 2) pthread3 is higher priority according to manual. pthread1 and
pthread2 are higher priority than pthread3.

[/] # pthread

ID       NAME             CPU SHED PRI STATE  MODES    EVENTS WAITINFO

----------------------------------------------------------------------------
--

0b010001  main_thread       1 MEDF 2147483645 READY P:T:nA   NONE   

0b010002  pthread1           2 MEDF 1789569706 READY P:T:nA   NONE   

0b010003  pthread2           2 MEDF 1789569706 READY P:T:nA   NONE   

0b010004  pthread3           2 MEDF 2147483646 READY P:T:nA   NONE



 

Please advise.

 

Best Regards,

JunBeom Kim

~~~~~~~~~~~~~~~~~~~~~~

President / EmbedCoreTech

Phone: +82-31-396-5584

Fax: +82-504-065-5720

Mobile:+82-10-6425-5720

Email:  <mailto:jbkim at e-coretech.kr> jbkim at e-coretech.kr 

Web:  <http://www.e-coretech.kr> www.e-coretech.kr 

~~~~~~~~~~~~~~~~~~~~~~

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20181228/812bf075/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 16816 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20181228/812bf075/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 14673 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20181228/812bf075/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 16956 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20181228/812bf075/attachment-0005.png>


More information about the users mailing list