ACE_Remote_Mutex 如何工作?

发布于 2024-10-20 14:29:10 字数 624 浏览 7 评论 0原文

我编写了两个小程序,试图获取名为“令牌”的相同远程互斥锁:

ACE_Remote_Mutex token("The Token", 1, 1);
token.acquire();
ACE_OS::sleep(5);
token.release();
return 0;

它们都得到以下调试输出:

(3078597488) acquired The Token
(4243|3078597488) BIG PROBLEMS with get_connection: Connection refused
error on remote acquire, releasing shadow mutex.
(3078597488) released The Token, owner is no owner
(4243|3078597488) BIG PROBLEMS with get_connection: Connection refused
(3078597488) release failed: Permission denied.
(3078597488) shadow: release failed

ACE_Remote_Mutex 是否仅与某种“代理”(如 Corba 代理)一起工作?我可以修改我的代码吗?

I wrote two small programs which tried to acquire the same Remote Mutex named "The Token":

ACE_Remote_Mutex token("The Token", 1, 1);
token.acquire();
ACE_OS::sleep(5);
token.release();
return 0;

Both of them got the following debug output:

(3078597488) acquired The Token
(4243|3078597488) BIG PROBLEMS with get_connection: Connection refused
error on remote acquire, releasing shadow mutex.
(3078597488) released The Token, owner is no owner
(4243|3078597488) BIG PROBLEMS with get_connection: Connection refused
(3078597488) release failed: Permission denied.
(3078597488) shadow: release failed

Does ACE_Remote_Mutex work only with some sort of "agent" like Corba broker? Can I modify my code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海之角 2024-10-27 14:29:10

Remote_Mutex 使用令牌服务来获取锁。 Token Service 不是 CORBA 服务,但起着类似的作用。以下是动态启动令牌服务的 svc.conf 条目示例:

dynamic Token_Service Service_Object * 
          ../lib/netsvcs:_make_ACE_Token_Acceptor() 
          "-p 10202" 

Remote_Mutex uses Token Service to acquire lock. Token Service is not a CORBA service but it plays a role similar to it. Here is an example of svc.conf entry that starts Token Service dynamically:

dynamic Token_Service Service_Object * 
          ../lib/netsvcs:_make_ACE_Token_Acceptor() 
          "-p 10202" 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文