<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 30 Aug 2016, at 20:00, shijunjie92 <<a href="mailto:shijunjie92@gmail.com" class="">shijunjie92@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: 'times new roman'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">The reason why I ask the last question is that I am trying to implement the 'help mechanism' of MrsP.</div></div></blockquote><div><br class=""></div><div>I haven’t tried implementing the MrsP myself, so I can’t really offer much specific guidance here.</div><br class=""><blockquote type="cite" class=""><div style="font-family: 'times new roman'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">The resource-holding task can be preempted by other higher priority normal execution task, but it still holds the resource. So I need to find out, is there any task in other processor is spinning and waitting for that resource. Sothat this processor can do the 'help'. Of cource, such task have been enqueued on the wait queue of that semaphore. But how can I locate that task when it locates on the middle of that queue?(traverse all the wait queue and compare to all the processors' spinning tasks?)</div></blockquote></div><br class=""><div class="">Good questions. These are exactly the kind of problems why “helping” and “migrate-on-blocking” policies are difficult to implement in a real OS, even though they look very appealing on paper. </div><div class=""><br class=""></div><div class="">For what it's worth, my MC-IPC implementation requires multiprocessor bandwidth inheritance, which runs into similar problems. It’s not part of the LITMUS^RT mainline version, but if you are interested I can share a version (that hasn’t been cleaned up yet) with you off list. (Of course, you’d get it as it is, no support implied, etc.)</div><div class=""><br class=""></div><div class="">- Björn</div><div class=""><br class=""></div></body></html>