I have a set of services running on different servers all accessing a shared resource, e.g; a list of folders containing videos that require some processing.
I want to implement some locking mechanism to prevent the services from accessing the same folder simultaneously, so far, my idea is creating a text file within a folder as an "in-folder-lock" and check if that file exists before processing the video files within.
I'm pretty sure this test won't do well in a real production setting where services look for folders to work on.
Any ideas?
Any help is appreciated, thanks in advance.