Q: Folder lock and processes syncronization I have 2 processes (let's call them P1 & P2). P1 reads data from a folder and P2 updates that folder. When P2 wants to update that folder (using rsync), it has to wait if P1 is reading and vice versa (P1 has to wait if P2 is updating the folder). I tried to use mutexes/semaphores and others... but I have a few problems like: if P2 crash while updating, then P1 will keep waiting for mutex/semaphore release.
Is there a way or something build-in linux to make the synchronization like this: the folder itself allow P1 to read data, while P2 wait to update, and if P1 crash, then there's no process to wait for, so P2 can update?
Or you have other suggestions?
