Conversation

Jarkko Sakkinen

Learned a cool trick in Python, if need to have more deterministic latency for a thread: shutdown the gc as prologue and do collection once as epilogue.

I.e.

gc.disable()
# Do stuff that does not cause CPU
# exceptions or interrupts.
gc.collect()

I also noticed that MicroPython has pretty usable inline assembler.

This makes me wonder if you could implement Python version of https://rtic.rs/2/book/en/ running hard real-time tasks on bare metal.

This is more like learning thing than challenging thing… I.e. by doing the similar thing perhaps in limited scope in other language it is easier to get grip of the original target…

#python #rustlang

1
2
3
I.e. I'm not claiming that it can be done. It is just that by reflecting with different tool you really get to the bottom of the bottlenecks, constraints and limitations. Just because it is fun and learning I guess...
1
0
0
And there is also other angle to this: would it be possible partition resources for a CPU core so that it would do RTIC in one thread as it was running on a single core CPU on bare metal, which is also pretty interesting problem. I think I look at Jailhouse hypervisor implementation for this one...
0
0
0