-
Notifications
You must be signed in to change notification settings - Fork 1.1k
unix-ffi: Fixing behavior to avoid zombie threads.#1046
unix-ffi: Fixing behavior to avoid zombie threads. #1046klukonin wants to merge 1 commit intomicropython:master from
Conversation
This commit is fixing this issue: micropython#780 Now the pid of child thread will be stored and closed properly. Even with context manager. Signed-off-by: Kirill Lukonin (Evil Wireless Man) <klukonin@gmail.com>
bf52092 to
08259d8
Compare
hodan121
commented
Oct 20, 2025
bump up
Josverl
commented
Oct 20, 2025
It would be good to add a test for this functionality,
that also helps with maintaining stability over time.
Other tests for the ffi module live in the micropython repo under tests/ports/unix
you could take one of the other ffi_ tests as the base, and add example code to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to use builtins.open so that the returned object is a stream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This _PopenStream object will need to implement read/write/etc operations, so that you can communicate with the process.
Eg prior to this patch it's possible to do:
import os ls = os.popen("/bin/ls") print(ls.read()) ls.close()
and that still needs to work.
klukonin
commented
Dec 2, 2025
I'll update the PR.
Thanks for the ideas, folks =)
Uh oh!
There was an error while loading. Please reload this page.
This commit is fixing this issue:
#780
As discussed here https://github.com/orgs/micropython/discussions/13239
Now the pid of child thread will be stored and closed properly. Even with context manager.