In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how RTP implements scheduling policies in VxWorks. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
After VxWorks has RTP, how does the system schedule? In fact, it is very simple: RTP does not participate in scheduling, VxWorks still uses the previous scheduling strategy, that is, all Task is based on priority preemption, and time slice rotation is turned off by default. This ensures that the highest priority Task ready to run in the system will be executed at any given time, regardless of whether the Task is in the kernel or in any process. In contrast, non-real-time systems mainly use time-sharing scheduling strategies and dynamically adjust process priorities to ensure that no process will be unable to use CPU for a long time, and that no process monopolizes CPU. VxWorks's time slice rotation is also a time-sharing strategy, but it does not interfere with priority preemption, so it is deterministic and ensures real-time performance.
If you are not going to use pthread, you can skip to the end of the article and like it now.
-dividing line-
However, in order to better support the POSIX standard, VxWorks introduces POSIX's Thread scheduling strategy into RTP. In fact, to use POSIX's Thread in RTP, you must include this scheduling strategy: INCLUDE_POSIX_PTHREAD_SCHEDULER
As you can see from the name, this strategy only works on Thread in RTP. Task and Thread in Kernel, and Task in RTP, all use the traditional strategy of VxWorks.
The scheduling policy of Thread cannot be dynamically switched to SCHED_SPORADIC, but it can be dynamically switched from SCHED_SPORADIC to other policies.
If you have enabled the time slice rotation strategy, and then use kernelTimeSlice () to change the time slice size, it will not affect the time slice of the Thread previously created using the SCHED_RR policy.
When pthread_setschedprio () is used to reduce the priority of Thread, the Thread will be queued to the head of the queue with the same priority, while when taskPrioritySet () is used to reduce the priority of Task, the Task will be queued to the end of the queue with the same priority.
Thank you for reading! This is the end of this article on "how to implement scheduling strategy in RTP in VxWorks". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.