异步Java RMI的 [英] Asynchronous Java RMI

查看:385
本文介绍了异步Java RMI的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近需要使用RMI,我知道足够我需要什么做的,但有一点是耐人寻味我,因为我讨论这个主题。是否有可能进行异步RMI调用服务器上相同的服务?

Recently I have needed to use RMI, and I know enough for what I need to do, but one thing is intriguing me as I revisit this topic. Is it possible to make asynchronous RMI calls to the same service on the server?

让我们说我有客户端和一个服务器端对象n个线程 - 称之为S. S有,我想从我的客户端线程调用一个方法,但我不希望它阻止,因为它没有共享资源的担心。

Let's say I have n threads on the client and a single server-side object--call it S. S has a single method that I want to call from my client-side threads, but I don't want it to block as it has no shared resource to worry about.

任何想法?或者是这个东西,只是更好地留给其他的方法呢?

Any ideas? Or is this something that is just better left to other methods?

推荐答案

有应该是这样做没有问题。它是多个客户端调用在从服务的角度来看,同时相同的服务的等效

There should be no issues with doing this. It is the equivalent of multiple clients calling the same service at the same time from the service's perspective.

任何服务器端对象应写入对并发访问是安全的。

Any server side object should be written to be safe for concurrent access.

这篇关于异步Java RMI的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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