My goal is to read multiple serial ports and store some data in a text file. The approach i took to do so is the following: