跨网络互斥 - C#.NET [英] Mutex across network - C#.NET

查看:116
本文介绍了跨网络互斥 - C#.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个共享系统上的消息队列。此队列是由其他2台机器上运行2个进程访问。我需要2个过程控制访问该队列。所以,我需要一个网络互斥体。我怎样才能做到这一点?

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?

我不认为这是支持出C#.NET盒子,但如果我错过了一些东西很明显,不要点我正确的方向。这个问题以前有人问,但建议的解决方案所涉及的数据库。我没有问题的任何数据库。

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.

http://stackoverflow.com/questions/1682699/how-to-mutex-across-a-network

推荐答案

您需要第三个过程,它实际拥有的排队项目。每两个工人问第三个过程的下一个项目,它的第三过程,政策准入和充当锁。

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.

这篇关于跨网络互斥 - C#.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆