If you want to have a simple and manual way to take care of file locking.
1) As soon as a process opens the csv, it creates a lock. (Lock can be in the form of creating a dummy file. The process has to delete the file(lock) as soon as it is done reading/updating the csv) 2) Have each process check for file lock before trying to update the csv. (If dummy file is present, some process is accessing the csv, else it can update the csv)
source share