I am using csv-parser to refresh data from a csv file to my program every 5 seconds, and another executable keeps writing new data to the file every 5 seconds.
If reading & writing happens to be in the same time, the ucrtbase thread crashes and then the entire program. I tried to wrap the operation in a try {} catch (...) {} block, but it seems try catch cannot access the thread created by csv-parser.
Can we do something to handle this without using a lock file? e.g. Just return a false flag so I can retry read 1 second later.