I'm writing a RunManager in python which should schedule tasks on a remote server (using SSH. each task is a process).
For the scheduling, I use a shared slots file on the remote server which denotes the number of available slots on that server.
Now, each user runs an instance of the RunManager, so there might be parallel accesses to the slots file. Is there a way for me to atomically increase/decrease the slot count (prevent race-condition)?
Searching 'Mutual protect shared file' on Google yields extreremely unrelated results.