Skip to content

Strange behavior when using _thread and asyncio on Raspberry Pi Pico #16899

Discussion options

You must be logged in to vote

I've only ever used asyncio on core 0. I would expect it to work on core 1, but see below.

In general MicroPython support for threading is rudimentary - see the warnings in the official docs. Most MicroPython objects are not thread-safe. Unless docs specifically state that an object is thread-safe, assume it is not. For technical details on the problems with sharing objects between threads, see this doc.

My advice on using the second core is to avoid it if possible: asyncio is all you need for most concurrency problems. If you are sure that a given problem cannot be solved by means of asyncio alone, carefully minimise the use of threading, read the above doc, and hold on tight for a chall…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@stupid-stove
Comment options

@peterhinch
Comment options

Answer selected by stupid-stove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants