xiaoxiang781216 commented on issue #9531: URL: https://github.com/apache/nuttx/issues/9531#issuecomment-1589785157
we are trying to call sched_lock in critical section(could be for spin lock), but it isn't very easy because: 1. sched_lock call enter_critical_section internally 2. The code of sched_lock is very long, directly call it in spinlock_irqsave reduce the performance a lot. > However, isn't it possible that another thread running on a different CPU could cause a higher priority thread to be started and that could cause the thread holding the spinlock to be blocked? It looks like that could happen and, if so, that would be bad. Am I missing something? Even thread running on other CPU trigger a scheduling on other cpu, the target cpu which call spin_lock_irqsave will postpone the request after spin_unlock_restore is called since IPI triggering schedule is also blocking too. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
