..
>I have an issue to be solved.

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Dear Andrew,
I have an aplication which will be run by different clients at a time.
Each instance will first find if an update is needed through a method
in the application. The instance which finds that first will be the
coordinator who sends message(multicast) to all other instances.
So in this scenario if two instances finds that an update is needed in
exactly the same time they have to compete using some strategy and
agree upon that either one of them who wins the strategy will be the
coordinator who will send update message to all the others in the
group. Its the issue of what strategy can I use to choose coordinator
and how to share that state among other instances? Hope I have
explained bit clear now. Do you have any idea?
Oliver Wong - 10 Apr 2007 16:27 GMT
> Dear Andrew,
>
[quoted text clipped - 10 lines]
> and how to share that state among other instances? Hope I have
> explained bit clear now. Do you have any idea?
Will the instances be running on the same computer, the same LAN, or
over the internet?
- Oliver
Robina Brintha - 10 Apr 2007 16:30 GMT
> > Dear Andrew,
>
[quoted text clipped - 15 lines]
>
> - Oliver
instances run in same computer...
Oliver Wong - 10 Apr 2007 17:12 GMT
>> > I have an aplication which will be run by different clients at a
>> > time.
>> > Each instance will first find if an update is needed through a method
>> > in the application. The instance which finds that first will be the
>> > coordinator who sends message(multicast) to all other instances.
[...]
>> Will the instances be running on the same computer, the same LAN,
>> or
>> over the internet?
>
> instances run in same computer...
Simplest solution is to try to acquire an exclusive resource in an
atomic fashion, and the first process to have successfully required this
resource is the "first" instance, and can act as the server or coordinator
or whatever.
Example include listening on a specific port or trying to gain
exclusive write-access to a specific file.
- Oliver
Andrew Thompson - 11 Apr 2007 01:54 GMT
...
>I have an aplication which will be run by different clients at a time.
You mention later that this will all be happening on one
single PC. *
>Each instance will first find if an update is needed through a method
>in the application. The instance which finds that first will be the
>coordinator who sends message(multicast) to all other instances.
* If that is the case, you might use the JNLP based SingleInstanceService **
to open a 'controller' application that launches a single screen of the
'user visible area' (AKA 'the application'). Later invocations will
'report to' that first controller instance, so it is possible to open
other UVA's as needed, while the controller is overseeing updates for
all.
** Here is an example <http://www.physci.org/jws/#sis>

Signature
Andrew Thompson
http://www.athompson.info/andrew/