I'll start of with a brief description: I'm building a system to monitor the temperatures in a chemical reactor as a school project. We measure with an arduino that sends the data as a string to a pc. On the pc we have a Java code to read out that string, parse it, and show it in a gui.
The problem we're facing is the following: We have a
- Class that reads the input string and prints it to the console
- Class that takes a dummy string of the correct format, parses it, and shows it in the GUI
The problem is that we're looking for a way to pass the data from the reader to the parser without interrupting the loop, and to make it threadsafe so we don't lose data. Is there an efficient way to do this?