Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mutex across network - C#.NET

Tags:

I have a message queue on a shared system. This queue is accessed by 2 processes which run on 2 other machines. I need to control access to this queue by the 2 processes. So I need a "network mutex". How can I achieve this?

I don't think this is supported out of the box in C#.NET but if I have missed something very obvious, do point me in the right direction. This question has been asked before but the solutions suggested involved a database. I dont have any database in question.

How To Mutex Across a Network?

like image 1000
atlantis Avatar asked Feb 01 '10 11:02

atlantis


1 Answers

You need a third process, which actually owns the queued items. The two workers each ask the third process for the next item, and it's this third process that polices access and acts as the lock.

like image 140
Will Avatar answered Oct 11 '22 23:10

Will