Hi, Yes, POSIX does not support priority inheritance on counting semaphores, but priority inheritance things seems to be already broken for a long time. I mean the changes like https://github.com/apache/incubator-nuttx/pull/5170 just highlight the top of an iceberg.
For the POSIX compliance of pthread mutexes default state to have PTHREAD_PRIO_NONE as a default protocol I will spin another discussion and will not overload this thread with irrelevant information. That changes will definitely affect many many applications, but we have to make a hard choice anyway. What I meant that POSIX pthread mutex case just shows that in general features that affect scheduling should be disabled by default and should be enabled in each and any usecase that requires it. At least this is my opinion. Best regards, Petro On Wed, Jan 5, 2022, 10:30 PM Gregory Nutt <spudan...@gmail.com> wrote: > More background: > > https://nuttx.yahoogroups.narkive.com/3hggphCi/problem-related-semaphore-and-priority-inheritance > > On Wed, Jan 5, 2022 at 2:22 PM Gregory Nutt <spudan...@gmail.com> wrote: > > > > I truly believe that priority inheritance on counting semaphores should > > be > > > > explicitly enabled (disabled by default) and enabling it by default might > > > > lead to unexpected priority boost for low priority tasks that violates > > > > real-time requirements. > > > > > > > > It has been enabled by default since day one so nothing will be broken. > > Disabling it now will break things – that is an orthogonal discussion to > > spec compliance. Currently, priorioty inheritance is explicitly disabled > > in all places where it should not be enabled (i.e., signaling semahores). > > > > > > > > If the default changes, then you would need to explicitly enable prority > > inheritance on all semaphores that are used as locks in order to retain > the > > previous behavior. See > > > https://cwiki.apache.org/confluence/display/NUTTX/Signaling+Semaphores+and+Priority+Inheritance > > – the POSIX definition does not have this issue because POSIX does not > > support priority inheritance on counting semaphores. > > > > > > >