Replies: 1 comment 2 replies
-
Hi @bob2oneil, I might be touching on something a bit different here, but since you're using Zephyr with native-posix, have you considered checking out their POSIX compatibility layer? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For the Native-POSIX board target, I need to change the thread priorities of an application for all kthreads in the application, both threads I explicitly create and those created via kernel configuration.
I am able to enumerate through all threads in the application using the k_thread_foreach() API with a callback.
In the callback, I need to obtain the thread ID that is somewhat equivalent to the pthread_self() API that I use for the main thread, and then I use a Linux API on that thread ID to enhance the thread priority when executing under Linux to make the Native-POSIX application behave more real time.
Nominally, the Linux priority for all threads has a value of 20, which is not sufficient for pseudo real time behavior under Linux.
Obtaining this handle via the callback mechanism is not apparent through an API from the k_thread pointer.
My code looks something like the following, what is missing the Thread ID obtained in the callback.
I need an ID of the data type pthread_t to use with the standard Linux API pthread_setschedparam().
The use of k_thread pointer provided as an argument to the callback does not work.
Beta Was this translation helpful? Give feedback.
All reactions