Running multiple instances of the same executable does not cause any problems. In the eyes of the operating system, these are two different processes. Each instance has its own page tables, file descriptors, stack, PID, etc., which are independent of all other instances.
But when you get access to the same resource in different processes, you need to synchronize access to resources using any of the blocking strategies. For example, two instances recording one file will lead to interference in the file, where one instance can write in the middle of another instance of the data.
Two instances read from one file will not be a problem, but when someone writes and the other reads, the result will be messy. Note. Each instance will have its own read / write pointer, where they read / write independently of other instances.
Since you are using the dataToRead.dat only dataToRead.dat file, you will not get any problems.
In general, there is no problem running multiple instances if you correctly synchronized access to resources.
source share