# US 2023/0267005 A1 · Thread management

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

- Number: US 2023/0267005 A1
- Document ID: US20230267005A1
- Status: Published application
- Kind: A1
- Application number: 17/651,943
- Filed: 2022-02-22
- Published: 2023-08-24
- Earliest claimed: 2022-02-22
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: NAIJIE LI; Bao Zhang; Ming Ran Liu; Yuan Zhai; Jia Yu; Peng Hui Jiang; Guang Han Sui
- Web page: https://patentgrep.com/patent/US20230267005A1

## CPC

- G06F 9/5016: {the resource being the memory}
- G06F 9/5022: {Mechanisms to release resources}
- G06F 9/45504: {Abstract machines for program code execution, e.g. Java virtual machine [JVM], interpreters or emulators}
- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06F 9/5055: {considering software capabilities, i.e. software resources associated or available to the machine}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A thread management process where a storage area template is generated for a plurality of threads that are to be created by a process in a computing system, the storage area template comprising at least one module template for at least one library that is to be loaded by the process. In the computing system, a plurality of storage areas is allocated for the plurality of threads based on the storage area template, respectively. The plurality of threads are managed based on the plurality of storage areas, respectively. All threads and libraries may be managed in a uniform way according to the storage area template. Therefore, thread management may be simplified and then may lead to reduced costs in the storage and time resources.

## Claims

### Claim 1

A computer-implemented method, comprising:
generating a storage area template for a plurality of threads that are to be created by a process in a computing system, the storage area template including a module template for a library that is to be loaded by the process, the library defining a set of variables;
allocating, in the computing system, a plurality of storage areas for the plurality of threads respectively, based on the storage area template; and
managing the plurality of threads based on the respective plurality of storage areas.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
generating the module template based on a set of libraries including the library, the module template corresponding to the library and being linked to a protected storage block in the computing system for storing the set of variables defined in the library;
wherein:
generating the storage area template is based on the module template.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
obtaining a storage requirement for the set of variables defined in the library; and
allocating the protected storage block in the computing system for the module template based on the storage requirement.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
determining a storage requirement for the set of variables based on a variable count and a set of variable types corresponding to set of variables defined in the library.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
in response to a detection that a thread in the plurality of threads is created by the process, copying the storage area template to a storage area in the plurality of storage areas to be allocated to the thread; and
allocating the storage area to the thread.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
in response to an access request to a target variable in the set of variables being received in the thread, managing the thread by accessing the protected storage block for the module template corresponding to the library.

### Claim 7 (depends on 6)

The method of claim 6, further comprising:
in response to a determination that a write request does not change an initial value that is configured in the protected storage block for the target variable, accessing the initial value based on the access request.

### Claim 8 (depends on 6)

The method of claim 6, further comprising:
in response to a determination that the access request changes an initial value that is configured in the protected storage block for the target variable, performing a method comprising:
allocating a new storage block in the computing system for replacing the protected storage block in the storage area;
modifying the storage area to link to the new storage block;
copying data in the protected storage block into the new storage block; and
modifying a value for the target variable in the new storage block based on the access request.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
in response to the library being classified as a static type, configuring respective initial values in the protected storage block for the set of variables defined in the library by configuring the respective initial values for the set of variables when the process is started in the computing system.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
in response to the library being classified as a dynamic type, configuring respective initial values in the protected storage block for the set of variables defined in the library by configuring the respective initial values for the set of variables when the library is loaded by the process.

### Claim 11

A computer-implemented system, comprising a computer processor coupled to a computer-readable memory unit, the memory unit including instructions that, when executed by the computer processor, implements a method comprising:
generating a storage area template for a plurality of threads that are to be created by a process in a computing system, the storage area template including a module template for a library that is to be loaded by the process, the library defining a set of variables;
allocating, in the computing system, a plurality of storage areas for the plurality of threads respectively, based on the storage area template; and
managing the plurality of threads based on the respective plurality of storage areas.

### Claim 12 (depends on 11)

The system of claim 11, further comprising:
generating the module template based on a set of libraries including the library, the module template corresponding to the library and being linked to a protected storage block in the computing system for storing the set of variables defined in the library;
wherein:
generating the storage area template is based on the module template.

### Claim 13 (depends on 11)

The system of claim 11, further comprising:
obtaining a storage requirement for the set of variables defined in the library; and
allocating the protected storage block in the computing system for the module template based on the storage requirement.

### Claim 14 (depends on 11)

The system of claim 11, further comprising:
determining a storage requirement for the set of variables based on a variable count and a set of variable types corresponding to set of variables defined in the library.

### Claim 15 (depends on 11)

The system of claim 11, further comprising:
in response to a detection that a thread in the plurality of threads is created by the process, copying the storage area template to a storage area in the plurality of storage areas to be allocated to the thread; and
allocating the storage area to the thread.

### Claim 16 (depends on 15)

The system of claim 15, further comprising:
in response to an access request to a target variable in the set of variables being received in the thread, managing the thread by accessing the protected storage block for the module template corresponding to the library.

### Claim 17 (depends on 16)

The system of claim 16, further comprising:
in response to a determination that the access request changes an initial value that is configured in the protected storage block for the target variable, performing a method comprising:
allocating a new storage block in the computing system for replacing the protected storage block in the storage area;
modifying the storage area to link to the new storage block;
copying data in the protected storage block into the new storage block; and
modifying a value for the target variable in the new storage block based on the access request.

### Claim 18

A computer program product, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by an electronic device to cause the electronic device to perform a method comprising:
generating a storage area template for a plurality of threads that are to be created by a process in a computing system, the storage area template including a module template for a library that is to be loaded by the process, the library defining a set of variables;
allocating, in the computing system, a plurality of storage areas for the plurality of threads respectively, based on the storage area template; and
managing the plurality of threads based on the respective plurality of storage areas.

### Claim 19 (depends on 18)

The product of claim 18, further comprising:
obtaining a storage requirement for the set of variables defined in the library; and
allocating the protected storage block in the computing system for the module template based on the storage requirement.

### Claim 20 (depends on 18)

The product of claim 18, further comprising:
in response to a detection that a thread in the plurality of threads is created by the process, copying the storage area template to a storage area in the plurality of storage areas to be allocated to the thread; and
allocating the storage area to the thread.
