# US 2012/0254885 A1 · Running a plurality of instances of an application

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2012/0254885 A1
- Document ID: US20120254885A1
- Status: Published application
- Kind: A1
- Application number: 13/419,963
- Filed: 2012-03-14
- Published: 2012-10-04
- Earliest claimed: 2011-03-31
- Assignees: International Business Machines Corporation
- Inventors: Jun Jie Cai; Heng Wang
- Web page: https://patentgrep.com/patent/US20120254885A1

## CPC

- G06F 9/5016: {the resource being the memory}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Running of a root instance of an application is started. The root instance includes at least one thread. In response to determining that a thread of the root instance runs to a preset freezing point in the application, running of all threads of the root instance is stopped. In response to starting to run an additional instance of the application, a running state of all threads of the root instance is replicated as a running state of all threads of the additional instance of the application. Running all threads of the additional instance of the application is continued.

## Claims

### Claim 1

A method for running a plurality of instances of an application, comprising:
starting to run a root instance of the application, the root instance comprising at least one thread;
in response to determining that a thread of the root instance runs to a preset freezing point in the application, stopping running all threads of the root instance;
in response to starting to run an additional instance of the application, replicating a running state of all threads of the root instance as a running state of all threads of the additional instance of the application; and
continuing to run all threads of the additional instance of the application.

### Claim 2 (depends on 1)

The method of claim 1, where the running state comprises at least: a current stack, values of registers, and a current instruction of a thread.

### Claim 3 (depends on 2)

The method of claim 2, where the current stack of the running state comprises a reference to an instance object in the additional instance, the reference to the instance object being initialized as pointing to a root instance object in the root instance.

### Claim 4 (depends on 3)

The method of claim 3, where the continuing to run all threads of the additional instance of the application comprises:
receiving a write operation to a field of the instance object;
in response to determining that the reference to the instance object points to the root instance object:
allocating a storage area for the additional instance object;
pointing the reference to the instance object to the allocated storage area; and
executing the write operation in the allocated storage area.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
in response to determining that the reference to the instance object does not point to the root instance object, executing the write operation in the allocated storage area to which the reference to the instance object points.

### Claim 6 (depends on 3)

The method of claim 3, where the continuing to run all threads of the instance of the application comprises:
receiving a write operation to a field of the instance object;
in response to determining that a corresponding field of the root instance object to which the reference to the instance object points is marked as not yet having executed a write operation:
allocating a storage area for the field of the instance object;
marking the corresponding field of the root instance object as having executed the write operation; and
executing the write operation in the allocated storage area.

### Claim 7 (depends on 6)

The method of claim 6, further comprising:
in response to determining that the corresponding field of the root instance object to which the reference to the instance object points is marked as having executed a write operation, executing the write operation in the storage area allocated for the field of the instance object related to the write operation.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
in response to determining that a thread of the root instance runs to a preset freezing point in the application, marking an attribute of a root instance object in the root instance as read only.

### Claim 9

A system for running a plurality of instances of an application, comprising:
a memory; and
a processor programmed to:
start to run a root instance of the application, the root instance comprising at least one thread;
in response to determining that a thread of the root instance runs to a preset freezing point in the application, stop running all threads of the root instance;
in response to start to run an additional instance of the application, replicate a running state of all threads of the root instance as a running state of all threads of the additional instance of the application; and
continue to run all threads of the additional instance of the application.

### Claim 10 (depends on 9)

The system of claim 9, where the running state comprises at least: a current stack, values of registers, and a current instruction of a thread.

### Claim 11 (depends on 10)

The system of claim 10, where the current stack of the running state comprises a reference to an instance object in the additional instance, the reference to the instance object being initialized as pointing to a root instance object in the root instance.

### Claim 12 (depends on 11)

The system of claim 11, where, in being programmed to continue to run all threads of the additional instance of the application, the processor is programmed to:
receive a write operation to a field of the instance object;
in response to determining that the reference to the instance object points to the root instance object:
allocate a storage area for the additional instance object;
point the reference to the instance object to the allocated storage area; and
execute the write operation in the allocated storage area.

### Claim 13 (depends on 12)

The system of claim 12, where the processor is further programmed to, in response to determining that the reference to the instance object does not point to the root instance object, execute the write operation in the allocated storage area to which the reference to the instance object points.

### Claim 14 (depends on 11)

The system of claim 11, where, in being programmed to continue to run all threads of the additional instance of the application, the processor is programmed to:
receive a write operation to a field of the instance object;
in response to determining that a corresponding field of the root instance object to which the reference to the instance object points is marked as not yet having executed a write operation:
allocate a storage area for the field of the instance object;
mark the corresponding field of the root instance object as having executed the write operation; and
execute the write operation in the allocated storage area.

### Claim 15 (depends on 14)

The system of claim 14, where the processor is further programmed to, in response to determining that the corresponding field of the root instance object to which the reference to the instance object points is marked as having executed a write operation, execute the write operation in the storage area allocated for the field of the instance object related to the write operation.

### Claim 16 (depends on 9)

The system of claim 9, where the processor is further programmed to:
in response to determining that a thread of the root instance runs to a preset freezing point in the application, mark an attribute of a root instance object in the root instance as read only.

### Claim 17

A computer program product for running a plurality of instances of an application comprising a computer readable storage medium including computer readable program code, where the computer readable program code when executed on a computer causes the computer to:
start to run a root instance of the application, the root instance comprising at least one thread;
in response to determining that a thread of the root instance runs to a preset freezing point in the application, stop running all threads of the root instance;
in response to starting to run an additional instance of the application, replicate a running state of all threads of the root instance as a running state of all threads of the additional instance of the application; and
continue to run all threads of the additional instance of the application.

### Claim 18 (depends on 17)

The computer program product of claim 17, where the running state comprises at least:
a current stack, values of registers, and a current instruction of a thread.

### Claim 19 (depends on 18)

The computer program product of claim 18, where the current stack of the running state comprises a reference to an instance object in the additional instance, the reference to the instance object being initialized as pointing to a root instance object in the root instance.

### Claim 20 (depends on 19)

The computer program product of claim 19, where, in causing the computer to continue to run all threads of the additional instance of the application, the computer readable program code when executed on the computer causes the computer to:
receive a write operation to a field of the instance object;
in response to determining that the reference to the instance object points to the root instance object:
allocate a storage area for the additional instance object;
point the reference to the instance object to the allocated storage area; and
execute the write operation in the allocated storage area.

### Claim 21 (depends on 20)

The computer program product of claim 20, where the computer readable program code when executed on the computer further causes the computer to:
in response to determining that the reference to the instance object does not point to the root instance object, execute the write operation in the allocated storage area to which the reference to the instance object points.

### Claim 22 (depends on 19)

The computer program product of claim 19, where, in causing the computer to continue to run all threads of the instance of the application, the computer readable program code when executed on the computer causes the computer to:
receive a write operation to a field of the instance object;
in response to determining that a corresponding field of the root instance object to which the reference to the instance object points is marked as not yet having executed a write operation:
allocate a storage area for the field of the instance object;
mark the corresponding field of the root instance object as having executed the write operation; and
execute the write operation in the allocated storage area.

### Claim 23 (depends on 22)

The computer program product of claim 22, where the computer readable program code when executed on the computer further causes the computer to:
in response to determining that the corresponding field of the root instance object to which the reference to the instance object points is marked as having executed a write operation, execute the write operation in the storage area allocated for the field of the instance object related to the write operation.

### Claim 24 (depends on 17)

The computer program product of claim 17, where the computer readable program code when executed on the computer further causes the computer to:
in response to determining that a thread of the root instance runs to a preset freezing point in the application, mark an attribute of a root instance object in the root instance as read only.
