Page 1 of 1

WiPy Timer Multithread

Posted: Wed Mar 15, 2017 3:34 pm
by iron2414
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

Re: WiPy Timer Multithread

Posted: Thu Mar 16, 2017 8:29 am
by pythoncoder
Perhaps it would be better to discard timer B and have the main loop periodically check for and communicate with a server.