I have a app which communicates with a weather monitor via a serial port. It has to send separate commands to retrieve each parameter. I do this periodically in a loop triggered by a 10 second timer. Each command is triggered in turn by the successful processing of the response from preceding one. Results are plotted on various graphs, and stored to various files, including a single-line file which is handy to see what is going on.
I initially developed this on an old machine, macOS 10.6 or 10.7 and it worked fine. The various machines I use it on have by and by been updated to macOS versions between 10.11, 10.13 and 10.14. They all show the same behaviour, as follows.
Everything is fine until the screen enters screen saver or sleep (the computer itself never sleeps). At this point the graph showing the first parameter in the 10 sec loop works fine, and the trace is fully complete if the screen is reactivated. The graphs for the subsequent parameters are straight lines, showing no update during that period.
The single-line file continues to be updated every 10 seconds. It includes a parameter "since", which records the seconds since the last valid measurement, and that is defined with reference to a time set when the last of the parameters has been read. Once the screen saver kicks in, that reference time is not updated and the "since" parameter grows steadily.
This indicates that the overall app is functioning fine during the screen save (timer, file writing etc.). But the handling of the serial port slows down so that only the first parameter gets processed until the loop restarts 10 sec later.
I'm looking for a solution.