Mar-03-2018, 09:33 PM
You may want to use a thread or a process depending on what your function1 and function2 are doing.
You can either start them manually, use a library like APScheduler to have a pool of threads/process and add your function to the job queue, or start thread/processes at the beginning of your code and have them read elements in a queue.
In the last case, your ReadSerial function would only have to put an element in a queue, which should minimize any interruption to the monitoring.
You can either start them manually, use a library like APScheduler to have a pool of threads/process and add your function to the job queue, or start thread/processes at the beginning of your code and have them read elements in a queue.
In the last case, your ReadSerial function would only have to put an element in a queue, which should minimize any interruption to the monitoring.