Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i synchronize 2 different Java Virtual Machines.

Status
Not open for further replies.

tzole

Programmer
Mar 21, 2001
3
GR
I have a main application (server) that reads and writes files from/to a specific path and gives them a specific ID (counter) (for example 0001.txt). Every time that the application reads or writes from/to a file, this ID is increased or decreased.
I want to make a client application(that uses a different Java Virtual Machine) to read and write from/to the same path which will use the ID from the server application to increase or decrease it.
How can i do this without having synchronization problems, i.e. by using the same ID both in the client and server application?
I use jdk 1.2.2 and jre 1.2, SUN Solaris.
Thanks in advance
tzole
 
Maybe I am missing the point here but just use RMI and synchronize any methods that change the counter.
Wushutwist
 
Thanks for your reply.Now I'm trying the RMI method and I'll inform you for the results.
Thank you again.Tzole
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top