I have 2 programs that must communicate with each other. They should share state (variables, files - i don't know how to achieve this). One program should read it and react on changes - the other should write to this global state.
Using files for this purpose is not even slow, it is difficult to read a file that someone writes at the same time.
What is the best way to achieve this shared state between programs? (looking for a cross-platform solution)