launching on Wintel/inter-process communication

Ken Ray kray at sonsothunder.com
Tue Dec 3 16:30:00 EST 2002


I was addressing how to deal with crashed files vs. not crashed files using
polling for a single application, not for using polling as a communication
medium between two apps. So in this case, the "second instance" is really
not a second running instance of the same application, but a relaunching of
the application because it crashed.

But in answer to your question, it woudl be because both instances of the
app are preprogrammed (either hard-coded or via a prefs file) to look in the
same place for files. For example, I have two apps that talk to each other
using a common folder for polling. App 1 looks for a file called "app1.cmd"
in the folder, and App 2 looks for a file called "app2.cmd" in the folder.
Since they are looking for different files, there's no collision. If App 2
writes the "app1.cmd" file to "tell" App 1 something, and App 1 had
previously crashed, the file would stay in the folder with the timestamp.
When App 1 was relaunched, it would see that file, but since it was sent
prior to its launch date, a decision can then be made (either ignore it - if
App 1 was very time-sensitive for example, or process it - if it doesn't
matter when App 1 gets the message).

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/


----- Original Message -----
From: <Yennie at aol.com>
To: <metacard at lists.runrev.com>
Sent: Tuesday, December 03, 2002 2:55 PM
Subject: Re: launching on Wintel/inter-process communication


> > Simple. Write the milliseconds into the file. Then, when the app
launches,
> > grab the milliseconds as its "launch date". When it goes to look in the
> > folder, it will read in the "leftover" file, but because the
milliseconds
> > in
> > the leftover is *earlier* than the launch date, it is ignored. It will
only
> > read files written into the "watched" folder *after* the launch date.
> >
> The time stamp seems logical- but here's my question: how does a second
> instance of the application know what file to look for? That is, if the
file
> is already there from the first instance which was launched hours ago, how
> can it tell the difference between that file and a crashed one. Without
using
> inter-application communication of course =).
>
> Or am I missing something?
>
> Brian
>
>
>




More information about the metacard mailing list