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?) ?
Asked
Active
Viewed 146 times
0
-
" Server crushes?" if hardware doesn't support, yes. But it is not directly related to your RMI implementation. – kosa Aug 07 '14 at 18:40
-
@Nambari, crashes, sorry) – sinedsem Aug 07 '14 at 18:43
-
1Why don't you test it and see what happens? – ra2085 Aug 07 '14 at 18:51
-
After you've ran some tests, then you can post some meaningful stacktraces on your question. – ra2085 Aug 07 '14 at 18:52
-
@ra2085 Because that might only yield an answer for a particular implementation or version. An answer deriving from the specification would be of more general use. – user207421 Aug 07 '14 at 20:23
1 Answers
1
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.

user207421
- 305,947
- 44
- 307
- 483