我们如何找出VxWorks中为什么会发生优先级继承呢?
我们有一个任务 State is Ready+I 。我们能找到它正在等待哪个任务来释放所有信号量吗?这是 6.0 之前的 vxworks
We have one task who State is Ready+I . Can we find which task is it waiting for to release all semaphores? This is pre-6.0 vxworks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您可以从任务中获得回溯,您应该会看到它被某种类型的系统实体(例如信号量)阻塞。您可以查看回溯中打印的 arg 列表,然后使用 C shell 中的 semShow 来获取有关该信号量的信息。其他系统同步实体提供类似的 *Show 例程。
假定实体支持“所有者”的概念,semShow 应显示所有者的 TID。
If you can get a backtrace from the task, you should see it blocked on some kind of system entity, e.g., a semaphore. You can look at the arg list printed in the backtrace, and then use semShow from the C shell to get information about that semaphore. Other system synchronization entities offer similar *Show routines.
Presuming that the entity supports the concept of an "owner", semShow should display the TID of the owner.
在基于 Tornado 的旧系统下,WindView 工具将允许您查看任务之间随时间变化的关系。 WindView 可以显示所有任务状态转换、中断、信号量操作等。
对于较新的基于 Workbench 的系统,相同的工具现在称为 System Viewer。
WindView/System Viewer 是调查您在任务状态方面遇到的任何问题以及问题是如何发生的的豪华方法。
Under the older, Tornado-based systems, the WindView tool will allow you to see the relationship between tasks over time. WindView can show all your task state transitions, interrupts, semaphore operations, etc.
For newer, Workbench-based systems, the same tool is now called System Viewer.
WindView/System Viewer is the deluxe way to investigate any problem you are having with task states and how they got that way.
如果我理解你的问题,那么你有一个任务继承了其他任务的优先级,并且你在识别这个其他任务时遇到了困难。我不记得
i
WindSh 命令是否打印继承的优先级,但如果确实如此,可能会告诉您应该查看哪些待处理任务。一旦将范围缩小到几个任务,您应该能够使用 tw 命令来打印有关任务挂起的对象的信息。顺便说一句,您为什么担心优先级继承?毕竟优先级继承不是问题,而是优先级反转的解决方案。
If I understand your question, you have a task that is inheriting the priority of some other task and you are having trouble identifying this other task. I don't recall if the
i
WindSh command prints the inherited priority but if it does that might give you a clue about which of the pended tasks you should look at. Once you've narrowed it down to a couple tasks you should be able to use thetw
command to print information on what object a task is pended upon.On a side note, why are you concerned about priority inheritance? After all priority inheritance isn't a problem, rather it is the solution to priority inversion.
如果你的任务是READY+I,我认为它不再等待信号量了。它正在等待访问CPU。您必须运行一个更高优先级的任务,该任务会阻止您的 READY+I 任务运行。
If your task is READY+I, i don't think it is waiting for semaphores anymore. It is waiting to access the CPU. You must have a higher priority task running that is preventing your READY+I task from running.