No 'signal' module for MP?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

No 'signal' module for MP?

Post by Jibun no kage » Wed Aug 17, 2022 6:32 pm

I take it, since I did not find anything about it, that the typical 'signal' module is not implemented in MP as yet? Or may never be as things stand at the moment? Not a problem just asking. I have some python code I was going to port over to MP, with some changes of course, that uses SIGINT, SIGTERM. And realized that 'signal' support is not in MP. Time to get creative.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: No 'signal' module for MP?

Post by jimmo » Wed Aug 17, 2022 11:38 pm

Jibun no kage wrote:
Wed Aug 17, 2022 6:32 pm
I take it, since I did not find anything about it, that the typical 'signal' module is not implemented in MP as yet? Or may never be as things stand at the moment? Not a problem just asking. I have some python code I was going to port over to MP, with some changes of course, that uses SIGINT, SIGTERM. And realized that 'signal' support is not in MP. Time to get creative.
Are you on the Unix port or on a microcontroller? There's no `signal` implementation because it doesn't really make sense on a microntroller.

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: No 'signal' module for MP?

Post by Jibun no kage » Thu Aug 18, 2022 4:04 pm

True, I was thinking about Unix port, but I also happen to be porting the code to ESP/Pico, it was sensor based, BMP280, BME280, etc., and that was when I looked for the signal support. Have not spent much time with I2C or SPI support in MP as yet, but I am going to have to restructure a few things.

The idea that it is often 'correct' to just reset or let a micro-controller reset, versus extensive clean up code, is counter culture to my experience on development on a traditional OS, such as Windows or Linux. But learning is fun, so interesting if different mind set.

However, I would raise one point, as multi-core micro-controllers have become the norm, and threading or other parallelism is leveraged across cores, inter-core communication, using signaling, or shared event states, that argues for such to mature on micro-controllers.

Post Reply