Thanks.  I remember this now.  We talked about this back in 2019!GregSent from 
my Galaxy
-------- Original message --------From: Xiang Xiao <xiaoxiang781...@gmail.com> 
Date: 4/23/23  10:09 PM  (GMT-06:00) To: dev@nuttx.apache.org Subject: Re: 
sched_lock() should be completely removed On Sun, Apr 23, 2023 at 10:42 PM 
Gregory Nutt <spudan...@gmail.com> wrote:>> > Let's focus on the first two 
item:> >> >     1. Add sched_lock()'s ability to the enter_critical_section()>> 
Some will need to explain what this means.  What is this?If someone wakes up a 
high priority thread inside the critical section(notprocess interrupt), the 
high priority thread will run immediately. Thesuggestion is disabling the 
schedule preempt too until the caller waitssomething proactively or leaves the 
critical section.>   Why is it> needed?  There is not sufficient information in 
this statement to> understand it.>Here is an example which replace sched lock 
with the critical section tofix a SMP 
bug:https://github.com/apache/nuttx/pull/3597/files#diff-2319a97549d1e962ba4aa93ef2de6fafe077a454637afb3b5d1d5a6c9ba65ab2R212-R221But,
 since the critical section isn't a superset of the schedule lock, itfails to 
achieve the requirement highlighted in the comment: /* Make sure that 
pre-emption is disabled to that we signal all of the   * members of the group 
before any of them actually run. (This does   * nothing if were were called 
from an interrupt handler).   */Since many people don't understand this special 
behaviour, we found severaltiming(very hard to reproduce) issues related to 
this behaviour in themainline before, that's why Jun made this proposal.

Reply via email to