diff options
author | Angus Gratton <angus@redyak.com.au> | 2025-05-23 14:39:37 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-06-04 11:31:12 +1000 |
commit | 7f274c7550654160f73b0de8fa73338dc58109a6 (patch) | |
tree | 219a9755e531528cd7c1978cb0e97ad76d013d0e /unix/scripts/upip.py | |
parent | b15348415e9d5ad2a978ca38a8da356faee88e91 (diff) | |
download | micropython-7f274c7550654160f73b0de8fa73338dc58109a6.tar.gz micropython-7f274c7550654160f73b0de8fa73338dc58109a6.zip |
py/scheduler: Only run scheduler callbacks queued before run started.
Without this change, a scheduler callback which itself queues a new
callback will have that callback executed as part of the same scheduler
run. Where a callback may re-queue itself, this can lead to an infinite
loop.
With this change, each call to mp_handle_pending() will only service the
callbacks which were queued when the scheduler pass started - any callbacks
added during the run are serviced on the next mp_handle_pending().
This does mean some interrupts may have higher latency (as callback is
deferred until next scheduler run), but the worst-case latency should stay
very similar.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'unix/scripts/upip.py')
0 files changed, 0 insertions, 0 deletions