Hi there, i've been searching for a while now and i haven't found any answer for my question: if i have 2 WiPy timer (let's call them timerA and TimerB for example), and they both tick almost the same time, then will the functions they call executed in parallel way (multithread), or will the second function be delayed until the first one finishes its execution? (like a sequential run)?
Why this is an issue for me: I have a WiPy and one MPU9150 sensor, i wanna read the sensor constantly with TimerA and store the valuable data in files on the WiPy. And With TimerB i wanna search for Wifi connections, and send all the data from the files to a webserver. However TimerB tick might take a while, for example if the files size are more than 1 MB then it could take seconds,maybe minutes until it sends everything to the webserver. And if reading the sensor data stops for this whole time, its a problem for me.
If its not multithreaded is there a way to make something like this happen?
Regards, iron2414
WiPy Timer Multithread
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: WiPy Timer Multithread
Perhaps it would be better to discard timer B and have the main loop periodically check for and communicate with a server.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.