You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Zephyr application written targeting the Native-POSIX board target, and wish to have more real-time behavior when operating under Linux. While the list of thread priorities is visible from the SHELL interface, when I observe the application and the number of both Zephyr and my application layer threads, they show up under application like htop as having Linux priority 20 (low priority).
There seems to be logic in the Zephyr source file /zephyr/lib/posix/pthread.c mapping Zephyr priorities to Linux POSIX priorities as zephyr_to_posix_priority(). However, putting a break point on this API during debugging as well as others in this source file did not yield any hits (including pthread_create()).
While I have been successful using the Linux POSIX specific APIs such as pthread_setschedparam() when run as root to increase the priority of my threads that I have created in the Zephyr application, and I have used the "nice" command when the application is launched to increase the suggested priority to -20, I have no control over the threads that Zephyr creates in Native-POSIX beyond what I can do with the "nice" command. For more near real-time behavior, I would like the Zephyr thread priorities to map to POSIX priorities. I can observe using htop the thread priorities set using the "nice" command as root user, and a single thread that I create in the application via pthread_setschedparam().
Why are the native pthread APIs not being called when targeting the Native-POSIX board target, and is there anything I can do at the application layer to enable more real-time thread priorities for both the application and Zephyr created threads?
The configuration CONFIG_POSIX_API suggests in the following CMakeList file inclusion of perhaps Linux threads rather than presumably Zephyr threads. But I am unable to use this kernel configuration targeting the Native-POSIX emulation board.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Zephyr application written targeting the Native-POSIX board target, and wish to have more real-time behavior when operating under Linux. While the list of thread priorities is visible from the SHELL interface, when I observe the application and the number of both Zephyr and my application layer threads, they show up under application like htop as having Linux priority 20 (low priority).
There seems to be logic in the Zephyr source file /zephyr/lib/posix/pthread.c mapping Zephyr priorities to Linux POSIX priorities as zephyr_to_posix_priority(). However, putting a break point on this API during debugging as well as others in this source file did not yield any hits (including pthread_create()).
While I have been successful using the Linux POSIX specific APIs such as pthread_setschedparam() when run as root to increase the priority of my threads that I have created in the Zephyr application, and I have used the "nice" command when the application is launched to increase the suggested priority to -20, I have no control over the threads that Zephyr creates in Native-POSIX beyond what I can do with the "nice" command. For more near real-time behavior, I would like the Zephyr thread priorities to map to POSIX priorities. I can observe using htop the thread priorities set using the "nice" command as root user, and a single thread that I create in the application via pthread_setschedparam().
Why are the native pthread APIs not being called when targeting the Native-POSIX board target, and is there anything I can do at the application layer to enable more real-time thread priorities for both the application and Zephyr created threads?
The configuration CONFIG_POSIX_API suggests in the following CMakeList file inclusion of perhaps Linux threads rather than presumably Zephyr threads. But I am unable to use this kernel configuration targeting the Native-POSIX emulation board.
https://github.com/zephyrproject-rtos/zephyr/blob/main/lib/posix/CMakeLists.txt
Beta Was this translation helpful? Give feedback.
All reactions