IP Library Granted Patent US 8,473,918
Granted Patent B2
US 8,473,918 · App. 12/017,230 · Granted Jun 25, 2013

Method for singleton process control

Inventors: Mario Francisco Acedo (Tucson, AZ); Ezequiel Cervantes (Tucson, AZ); Paul Anthony Jennas, II (Tucson, AZ); Jason Lee Peipelman (Vail, AZ); Matthew John Ward (Vail, AZ)
Assignee: International Business Machines Corporation
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,473,918
App. No.
12/017,230
Granted
Jun 25, 2013
Kind
B2
Abstract

A method for singleton process control in a computer environment is provided. A process identification (PID) for a background process is stored in a first temporary file. The PID is stored by a parent process and subsequently accessed by the background process. The background process is exited if an active PID is determined to exist in a second, global temporary file. The PID from the first temporary file is stored into the second, global temporary file. A singleton code block is then executed.

Claims (56)

1. A method for singleton process control in a computer environment, comprising:

storing a process identification (PID) of a last spawned process for a background process in a first temporary file, the PID stored by a parent process, and subsequently accessed by the background process that is initialized;

initializing a background process variable for keeping track of a predetermined number of tries the parent process is checked to determine if the parent process is alive;

determining if the parent process is alive for the predetermined number of tries, wherein a PID of the background process is written from the first temporary file into a first PID variable when the parent process ends;

storing into the background process variable for so long as the parent process is active;

determining whether a second, global temporary file is empty, wherein:

if the global temporary file is empty:

commencing for a first time an associated program with the PID of the background process if a second, global temporary file is empty, and

storing the PID of the background process from the first temporary file into the second, global temporary file, and

if the global temporary file is not empty:

determining if an existing PID stored within the second, global temporary file is active, wherein

if the existing PID is determined to be active in the second, global temporary file, exiting a process associated with the existing PID, and

if the existing PID is determined to be not active in the second, global temporary file, storing the PID of the background process from the first temporary file into the second, global temporary file;

writing the existing PID to a second PID variable; and

executing a singleton code block.

2. The method of claim 1 , further including creating the first temporary file.

3. The method of claim 2 , further including creating the second, global temporary file.

4. The method of claim 3 , further including starting the background process.

5. The method of claim 1 , further including if the predetermined number of tries is reached:

sleeping for a predetermined time, and

redetermining if the parent process is alive for the predetermined number of tries.

6. The method of claim 1 , further including issuing a call function to issue the PID for the background process.

7. The method of claim 1 , further including ensuring only one instance of the associated program is started by using the PID of the background process and not using program names, wherein a wrapper script returns a prompt to a user as calls to start a program as the parent process dies.

8. A computer program product for singleton process control in a computer

environment, the computer program product comprising a non-transitory computer-readable

storage medium having computer-readable program code portions stored therein, the computer-readable program code portions comprising:

a first executable portion that stores a process identification (PID) of a last spawned

process for a background process in a first temporary file, the PID stored by a parent process, and subsequently accessed by the background process that is initialized;

a second executable portion that initializes a background process variable for keeping

track of a predetermined number of tries the parent process is checked to determine if the parent process is alive;

a third executable portion that determines if the parent process is alive for the

predetermined number of tries, wherein a PID of the background process is written from the

first temporary file into a first PID variable when the parent process ends;

a fourth executable portion that stores into the background process variable for so long as the parent process is active;

a fifth executable portion that determines whether a second, global temporary file is

empty, wherein:

if the global temporary file is empty:

commencing for a first time an associated program with the PID of the background process if a second, global temporary file is empty, and

storing the PID of the background process from the first temporary file

into the second, global temporary file;

if the global temporary file is not empty:

determining if an existing PID stored within the second, global temporary file is active, wherein:

if the existing PID is determined to be active in the second, global temporary file, exiting a process associated with the existing PID, and

if the existing PID is determined to be not active in the second, global temporary file, storing the PID of the background process from the first temporary file into the

second, global temporary file;

a sixth executable portion that writes the existing PID to a second PID variable; and

a seventh executable portion that executes a singleton code block.

9. The computer program product of claim 8 , further including an eighth executable portion that ensures only one instance of the associated program is started by using the PID of the background process and not using program names, wherein a wrapper script returns a prompt to a user as calls to start a program as the parent process dies.

10. The computer program product of claim 8 , further including a ninth executable portion that creates the first temporary file.

11. The computer program product of claim 10 , further including a tenth executable portion that creates the second, global temporary file.

12. The computer program product of claim 11 , further including an eleventh executable portion that starts the background process.

13. The computer program product of claim 12 , further including if the predetermined number of tries is reached:

a twelfth executable portion that sleeps for a predetermined time, and

a thirteenth executable portion that redetermines if the parent process is alive for the predetermined number of tries.

14. The computer program product of claim 8 , further including a fourteenth executable portion for issuing a call function to issue the PID for the

background process.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 15, 2021
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: AIRBNB, INC.
Reel/Frame 056427/0193 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 27, 2008
From: ACEDO, MARIO FRANCISCO; CERVANTES, EZEQUIEL; JENNAS, PAUL ANTHONY, II; PEIPELMAN, JASON LEE; WARD, MATTHEW JOHN
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 020565/0282 →
Continuity (1)
Related Publication 20090187888A1 · Jul 23, 2009