using second core to run blocking code #11870
GM-Script-Writer-62850
started this conversation in
General
Replies: 2 comments 8 replies
-
See this doc. The idea is to use the 2nd core so that the main |
Beta Was this translation helpful? Give feedback.
6 replies
-
As @rkompass says, you can't do that. If you have multiple blocking functions there are two options: use a target that supports multiple threads or have a task which waits for them in sequence - i.e. run them sequentially rather than concurrently: async def taskA():
await unblock(sleep,2)
await unblock(sleep,2) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So if i have
uasyncio
running on one core, how can i use_thread
to run say urequest or read a sensor and await it's completion and get the return valueIIRC there would be a issue running urequest on core 1 of a PICO W assuming wifi was setup on core 0, but not every NIC has that limitation
i know there will be some complications where i may need to have another process wait for core 1 to be freed up
Beta Was this translation helpful? Give feedback.
All reactions