• Post Reply Bookmark Topic Watch Topic
  • New Topic

Threads and Synchronization  RSS feed

Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is regarding using single instance for all the threads
I am having a .zpy on the server.when this file is
my first login screen should be invoked on the client machine and a thread
will be created.Assume the application exists on the client machine.we are
able to do this,ie I can associate the file types and invoke the application
But what the problem is when another .zpy file comes from the server at the
same time another
thread will be created but it has to use the same instance of the login
screen and it should not open another instance.
What is this .zpy file?
When a user shops on the merchant site(amazon.com) all his shopping
information like
order no and amount will be inside this .zpy file.
so when this file come I am associating this file with my swing application
and create a thread.
This is working fine.
Problem is when another .zpy file comes, this situation arises when he goes
to some other
merchant site(books.com) at the same time and he purchases some items
another .zpy file will be sent.so we should able to use same instance of
swing application for the second thread.

Thanks in advance
With Regards,
Pawel Veselov
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I undertood everything right, you have two application instances for processing each of <code>.zpy</code> file.
In this case you'll be unable to use java threads synchronization, since you can't synchronize between different VMs.
To resolve this problem you need to create some sort of proxy application, that will redistribute the i/o stream from itself to already existing java application (in memory) or to launch java application and then pass this stream to it.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!