diff options
author | Angus Gratton <angus@redyak.com.au> | 2024-01-10 11:36:17 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-05-31 16:46:27 +1000 |
commit | 3af006efb39ad0b7aa7c0401c93329b654bca617 (patch) | |
tree | e90bc60a504c4c411914a6bf96c01e3f536bca59 /docs/esp8266/tutorial/powerctrl.rst | |
parent | 83e82c5ad3fb9e8796d786e01509d264cfb205d3 (diff) |
rp2: Support calling pendsv_suspend/resume from core 1.
Previously, this was subject to races incrementing/decrementing
the counter variable pendsv_lock.
Technically, all that's needed here would be to make pendsv_lock an atomic
counter.
This implementation fulfils a stronger guarantee: it also provides mutual
exclusion for the core which calls pendsv_suspend(). This is because the
current use of pendsv_suspend/resume in MicroPython is to ensure exclusive
access to softtimer data structures, and this does require mutual
exclusion.
The conceptually cleaner implementation would split the mutual exclusion
part out into a softtimer-specific spinlock, but this increases the
complexity and doesn't seem like it makes for a better implementation in
the long run.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'docs/esp8266/tutorial/powerctrl.rst')
0 files changed, 0 insertions, 0 deletions