• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple JVM, Shared Memory, Single Thread

 
Pat Denton
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been asked to research a potentially disasterous situation. We have 25 JVM's processing requests. We jave an executable that is single threaded although is being accessed via JNI by 1 or more of the 25 JVM's. The class that accesses this executable has been modified so that the method is synchronized as to only allow a single request at a time.

Here are my assumptions.

If the JVM's are sharing memory and the stated class is placed in that shared memory region, the calls to JNI won' crap out because the method is synchronized, however, the requests could get so backed up, http craps out waiting for responses back from the system.

If the JVM's are NOT sharing memory, then as soon as JVM-1 hits the executable and then JVM-2 requests the executable, the executable will crap out because it is single threaded.

Is this accurate? What am I missing?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12038
223
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pat,

Your assumptions sound logical to me.

As long as you can only have a single thread accessing the executable, you run the risk of it becoming the bottleneck. Is there any way you can cache the information received from the executable or run multiple instances of it?

Regards, Andrew
 
Hemal Pandya
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pat Denton:
If the JVM's are sharing memory and the stated class is placed in that shared memory region, the calls to JNI won' crap out because the method is synchronized.



Synchronization in java refers only to a single a JVM. You will need some external mechanism for serializing access to the executable across multiple processes.
[ November 24, 2005: Message edited by: Hemal Pandya ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!