Search code examples
javarmihigh-load

RMI: many requests, one data


I have RMI server with 2 methods: first changes some value in an array, second reads some value. Array is located in the server's memory. And I have a lot of (1-∞) clients, which call these methods. What happens when a few clients try to change the same value at the same time? Server crashes? Or only acces time increased (server makes request queue?) ?


Solution

  • What happens when a few clients try to change the same value at the same time? Server crashes? Or only acces time increased (server makes request queue?) ?

    Neither. The RMI Specification carefully states that there are no guarantees about server-side threading. That means that all the calls can execute concurrently. It is up to you to provide any required synchronization.