Detecting prior instances of an application
From: Chris (dunawayc_at_gmail.com)
Date: 01/06/05
- Next message: Chris: "Detecting prior instances of an application"
- Previous message: Joseph MCAD: "RE: Connecting VB.net 2003 standard and SQL Server"
- Messages sorted by: [ date ] [ thread ]
Date: 6 Jan 2005 12:13:43 -0800
I need to be able to detect a prior instance of my application (console
app) if it is run again. The app is normally run on a set schedule and
most of the time, the first instance will be finished before it is run
again, but occasionally, the first app will not complete in a timely
enough fashion and may still be processing when the schedule kicks it
off again.
I know I can use a Mutex for this purpose, but I additionally need for
the second instance to somehow signal the first so it knows it has
additional processing to do.
Something like this:
First instance starts and begins processing.
Second instance is kicked off before first instance finishes.
Second instance detects first instance and signals first instance
(How??)
Second instance closes.
First instance finishes processing and sees that the second instance
has signalled it.
First instance begins processing again.
What mechanism would be the easiest for the second instance to signal
the first? Would a semaphore be appropriate in this instance? Does
the .Net framework support semaphores? I will check that out, but does
anyone have any other suggestions?
Thanks,
- Next message: Chris: "Detecting prior instances of an application"
- Previous message: Joseph MCAD: "RE: Connecting VB.net 2003 standard and SQL Server"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|