02-27-2017 08:21 AM - edited 02-27-2017 08:21 AM
Hello all,
I am trying to continuosly acquire data, find peaks and save them in a text file. This process can last upto few minutes.
Now i would like to continuosly read back from the stored peaks and plot a histogram of the peaks stored in the file. I also want to update the histogram as the file gets updated.
02-27-2017 11:57 AM
Instead of trying to do a "write and read back", particularly for a continuous process where you continue to acquire, find peaks, and save, I recommend the following Producer/Consumer design:
The purpose of Producer/Consumer patterns is to "decouple" time-critical stuff (like acquiring data, and saving it to disk) from less-time-critical stuff (like writing to disk and forming histograms). Note that much of the data (any raw data, for example) is not kept in memory, but processed and "reduced" for later use. Efficient use of Time (cpu) and Space (memory).
Bob Schor
02-28-2017 07:51 AM
Thanks Bob for this nice algorithm. Any examples would be of great help.