0
kicks
Using lock files for simple interprocess co-ordination mechanism
When developing robust reliable services you often need the ability to run multiple instances of those services on the same or different servers for reliability or scalability reasons. When managing processes outside of a database you may need a mechanism to block access to a resource (say an email in-box) while another instance of your service is working on that resource.
To manage such cases we often use a mechanism of accessing a file using an exclusive lock on it, and if that lock cannot be acquired then we know something else is working on that resource.