Semaphore file to handle concurrent accesses

Problem

I have a script whose main purpose is to increase a counter present in a file (ok, this is a basic example, but this can be generalized to a lot of concurrent access problem).

Several instances of this script could be ran at the same time, this can raise synchronization problem as several instance could manipulate the data contained in the file at the same time.

Lire la suite