Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #2797

Re: program Restart

From JJ <jaejunks@nah.meh>
Newsgroups comp.programming
Subject Re: program Restart
Date 2013-01-12 07:08 +0000
Organization A noiseless patient Spider
Message-ID <XnsA146900121BD5jj@0.0.0.17> (permalink)
References <d992765a-ba00-40c0-83f6-4ff3a85c4304@googlegroups.com>

Show all headers | View raw


bob <bob@coolfone.comze.com> wrote:
> Some programs such as Eclipse have an option for you to "Restart" them.
> 
> What is a general method for a program to "Restart" itself?

If the program's data is not safe for use by multiple instances... i.e.: 
only one instance is allowed.

Use a system-wide named flag (where duplicates of the same name can't be 
made) to as a marker to indicate the existence of a program instance.

Use a command line parameter such as "-restart" to make the program wait 
for any existing marker to vanish (existing instance is terminated) before 
creating the system-wide named flag. If the command line is not specified 
and another instance exists, terminate itself immediately.

To restart the program, simply execute itself then terminate.

Back to comp.programming | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

program Restart bob <bob@coolfone.comze.com> - 2013-01-11 09:21 -0800
  Re: program Restart Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-01-11 11:34 -0800
  Re: program Restart JJ <jaejunks@nah.meh> - 2013-01-12 07:08 +0000

csiph-web