Repository navigation
Conversation
5f204d7 to
b3bad6a
Compare
99f377d to
130061d
Compare
|
rebased on after #5769 |
|
Thanks for this, it's a good addition. I was just thinking if there could be a way to eliminate the duplication of code, all the very similar for-ever loops that keep going while there is EINTR. Possible ways to factor the code:
Macros and inline functions won't help to reduce code size, but probably a macro is the only way to do it without getting to messy. |
|
Some other points:
|
|
I've added a few commits for discussion. They can be squashed if all are acceptable. I made a macro There was quite a variety of cases to cover with a single macro. I was able to get all but one without getting too crazy. I also made an intermediate commit with a |
Yes, we would need to use something like ptrace to intercept the system calls. e.g. https://nullprogram.com/blog/2018/06/23/ |
|
The unix coverage thread_stacksize1 test failure seems to be unrelated to this PR as I am getting the same failure locally without these changes. |
|
Thanks for updating. I think the |
There was a problem hiding this comment.
removal of this is a nice clean-up, can be done in a separate commit/PR
|
I went ahead and squashed the commits, keeping the Also I split out the cleanup as suggested in #5782, so it would be best to merge that first before merging this PR. |
https://www.python.org/dev/peps/pep-0475/ This implements something similar to PEP 475 on the unix port. There are a few differences from the CPython implementation: - Since we call mp_handle_pending(), addition functions could be called if MICROPY_ENABLE_SCHEDULER is enabled, not just signal handlers. - CPython only handles signal on the main thread, so other threads will raise InterruptedError instead of retrying. On MicroPython, mp_handle_pending() will currently raise exceptions on any thread. A new macro MP_HAL_RETRY_SYSCALL is introduced to reduce duplicated code and ensure that all instances behave the same. This will also allow other ports that use posix-like system calls to provide their own implementation if needed.
|
rebased to fix merge conflict |
|
Ok, merged in 9418611 |
traceback: fix for crash on non-native exceptions
https://www.python.org/dev/peps/pep-0475/
This implements something similar to PEP 475 on the unix port.
There are a few differences from the CPython implementation:
MICROPY_ENABLE_SCHEDULERis enabled, not just signal handlers.InterruptedErrorinstead of retrying. On MicroPython,mp_handle_pending()will currently raise exceptions on any thread.