Using lock files for simple interprocess co-ordination mechanism(lysaghtn.weebly.com)

submitted by bigtoebigtoe(25) 3 years, 11 months ago

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.

3 comments |category: |Views: 17

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by yesthatmcgurkyesthatmcgurk(4063) 3 years, 11 months ago 0

Holy JFC that's a HORRIBLE hack. I feel queezy just thinking about it...

Reply

posted by yesthatmcgurkyesthatmcgurk(4063) 3 years, 11 months ago 0

(Enjoy your denial of service hacks, btw)

Reply

posted by bigtoebigtoe(25) 3 years, 11 months ago 0

Hi folks, this technique is not meant to be used in web-sites/web-services. But is useful in the world of Windows Services, and out of band processing where access to a database is not available and I can guarantee that it works well, is very safe and manages disaster recover situation very well.

Maybe I should have made that a little clearer in the posting. Anyhow onwards and upwards.

Reply

information Login or create an account to comment on this story