hujun260 commented on code in PR #18199:
URL: https://github.com/apache/nuttx/pull/18199#discussion_r2750469989
##########
sched/semaphore/sem_clockwait.c:
##########
@@ -137,14 +137,14 @@ int nxsem_clockwait(FAR sem_t *sem, clockid_t clockid,
ret = nxsem_wait(sem);
+ leave_critical_section(flags);
Review Comment:
> 1. This interface requires greater determinism, rather than an occasional
spurious extra callback.
> 2. The implementation of wd_cancel also invokes critical section code. If
csec is implemented with reference counter, it’s unclear which approach offers
better performance.
> 3. If you do not delete the node, other WD timers will incur an extra
traversal when being added to the global linked list, leading to even higher
overhead.
There isn't just a single wdtimer in the system.,Since wd timer events
happen frequently, why would this affect determinism?
If there is a wait operation within the critical section, the current CPU
will release it (the critical section) by itself.
Expanding the scope of the critical section protection does not guarantee
determinism.
--
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]