且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

RMI java - 2 客户端 1 服务器中的竞争条件

更新时间:2023-10-17 20:36:34

本教程 演示了 RMI 服务器的线程特性(参见任务 7.1).他们引用了 RMI 规范:

This tutorial demonstrates the threaded nature of RMI servers (see task 7.1). They quote from the RMI spec:

由 RMI 运行时调度的方法到远程对象实现(一个服务器)可能会或可能不会在一个单独的线程.呼叫始发来自不同客户 虚拟机器将以不同的方式执行线程.来自同一台客户端机器不保证每种方法将在单独的线程中运行

A method dispatched by the RMI runtime to a remote object implementation (a server) may or may not execute in a separate thread. Calls originating from different clients Virtual Machines will execute in different threads. From the same client machine it is not guaranteed that each method will run in a separate thread

因此来自不同客户端的调用将导致通过服务器中的不同线程执行.

so invocations from different clients will result in execution via different threads in the server.