patacongo commented on issue #9531:
URL: https://github.com/apache/nuttx/issues/9531#issuecomment-1590009468

   PART II
   
   > 1. sched_lock call enter_critical_section internally
   
   Perhaps that the critical section might be replaced with something like 
spin_lock_irqsave().  Most of the logic is clearly safe; the only tricky part 
is the call to nxsched_merge_prioritized() that does require a critical section.
   
   So sched_lock() would not work without some additional logic.
   
   > 2. The code of sched_lock is very long, directly call it in 
spinlock_irqsave reduce the performance a lot.
   
   Does enter_critical_section() now call sched_lock()?  I don't see that call 
but I know we talked about that in the past.
   
   Since spin_lock() already calls enter_critical_section(), my concern in this 
case will be fixed when the general issue is fixed.
   
   Also, my preference would be lose a bit of performance if that is what is 
necessary to avoid the  hard performance bug that would occur if the a thread 
is blocked indefinitely while holding a spinlock.
   
   


-- 
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]

Reply via email to