-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ports/unix: uasyncio.ThreadSafeFlag appears broken #7965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
On everything-except-unix, we use a built-in implementation of select() (in extmod/moduselect.c), which knows how to poll Python objects implementing the stream protocol. However, on Unix it uses the "native" (i.e. posix) select, which only knows about file descriptors (hence why None can't be converted to int). The correct fix is to make the Unix select implementation also support Python objects (i.e. a hybrid of
I have a variant that I use for BLE testing and aioble development that sets this. I've wondered about proposing to make this the default for the unix port... (generally my view is that the default unix port should mirror the bare-metal port, and a "more CPython like" build can be enabled via a variant) but other use cases depend on the posix behavior so this would be a breaking change. Longer term we plan to improve uasyncio's event-waiting (see #6125 and linked PRs) this will work the same across the different ports. In the meantime, it's probably an oversight that https://docs.micropython.org/en/latest/library/uasyncio.html#class-threadsafeflag doesn't mention this behavior. |
As per micropython#7965 this class does not work on the Unix build.
As per Issue micropython#7965, this class does not work on the Unix build.
As per Issue micropython#7965, this class does not work on the Unix build.
As per Issue micropython#7965, this class does not work on the Unix build.
STM: monotonic time even when RTC is changed
The minimal program to reproduce the issue:
The result:
I poked around it a bit, and the flow to the failure is as follows:
micropython/extmod/uasyncio/core.py
Line 79 in cb99ca9
micropython/ports/unix/moduselect.c
Line 88 in cb99ca9
micropython/ports/unix/moduselect.c
Line 76 in cb99ca9
This ends up in
ThreadSafeFlag.ioctl()
, which returns None for any request other thanMP_STREAM_POLL
and causes the exception above.micropython/extmod/uasyncio/event.py
Lines 47 to 50 in cb99ca9
The text was updated successfully, but these errors were encountered: