Multi threading

General discussion about topics related to OpenMV.
Jivrik
Posts: 19
Joined: Thu Jan 10, 2019 9:40 pm

Multi threading

Postby Jivrik » Sat Feb 02, 2019 7:49 pm

Hi,

Is it possible to run simultaneously many functions in the openMV ?

I mean if I have a function start() and a function got() ; and I want them to run at the same time , Would it be possible ?


Also, when it comes to execute the whole code, does the OpenMV execute the code line by line;
or it changes it into machine language before any execution?
I mean Interpreter or Compiler ?


Thank you!
User avatar
kwagyeman
Posts: 3207
Joined: Sun May 24, 2015 2:10 pm

Re: Multi threading

Postby kwagyeman » Sat Feb 02, 2019 8:15 pm

Hi, MicroPython compiles the code into byte code. If you want multi-threading you'll have to wait until it's supported by MicroPython.
Nyamekye,
Jivrik
Posts: 19
Joined: Thu Jan 10, 2019 9:40 pm

Re: Multi threading

Postby Jivrik » Sat Feb 02, 2019 9:54 pm

:lol: Thank you!
User avatar
iabdalkader
Posts: 918
Joined: Sun May 24, 2015 3:53 pm

Re: Multi threading

Postby iabdalkader » Wed Feb 06, 2019 6:23 pm

Just for the record, multi-threading is supported by MicroPython but it's experimental and disabled by default. Also I'm not so sure it will play nice with our modifications. So it will probably never happen. If you want to call some function periodically you should use timers. See the timer control example: 02-Board-Control->timer_control.py

Return to “General Topics”

Who is online

Users browsing this forum: chenyukai and 12 guests