# US 2023/0058935 A1 · Managing return parameter allocation

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

- Number: US 2023/0058935 A1
- Document ID: US20230058935A1
- Status: Published application
- Kind: A1
- Application number: 17/405,646
- Filed: 2021-08-18
- Published: 2023-02-23
- Earliest claimed: 2021-08-18
- Assignees: Micron Technology, Inc.
- Applicants: Micron Technology, Inc.
- Inventors: Tony Brewer; Patrick Estep; Skyler Arron Windh
- Web page: https://patentgrep.com/patent/US20230058935A1

## CPC

- G06F 9/3009: {Thread control instructions}
- G06F 9/3004: {to perform operations on memory}
- G06F 9/30101: {Special purpose registers}
- G06F 9/30116: {Shadow registers, e.g. coupled registers, not forming part of the register space}
- G06F 9/30123: {according to context, e.g. thread buffers}
- G06F 9/3806: {using address prediction, e.g. return stack, branch history buffer}
- G06F 9/3851: {from multiple instruction streams, e.g. multistreaming}
- G06F 9/3889: {controlled by multiple instructions, e.g. MIMD, decoupled access or execute}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A hybrid threading processor (HTP) supports thread creation by executing an instruction that indicates an amount of storage space to reserve for return values. Before a thread is created, the indicated amount of space is reserved. The newly created child thread sends a return packet back to the parent thread when the child thread completes. The thread writes its return information into the reserved space and waits for the parent thread to execute a thread join instruction. The thread join instruction takes the returned information from the reserved space and transfers it to the parent thread's register state. The reserved space is released once the child thread is joined. Using a configurable amount of space for each child thread may allow for more child threads to be executed simultaneously.

## Claims

### Claim 1

An apparatus comprising:
a memory interface coupled to a memory;
a data cache;
an instruction cache; and
a processing element configured to:
access data from the data cache; and
execute instructions from the instruction cache to perform operations comprising:
receiving a thread create instruction from a parent thread executing on the processing element, the thread create instruction indicating a number of return parameters to be generated by a child thread created by the thread create instruction;
reserving, via the memory interface and based on the number of return parameters, space in the memory to store the return parameters;
creating the child thread based at least in part on the reserving of the space in the memory; and
providing access to the return parameters from the reserved space to the parent thread based at least in part on a thread return instruction from the child thread.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein:
the operations further comprise receiving a join instruction from the parent thread; and
the providing of the access to the return parameters from the reserved space to the parent thread is in response to the receipt of the join instruction.

### Claim 3 (depends on 2)

The apparatus of claim 2, wherein:
the thread create instruction further indicates a caller identifier; and
the caller identifier is provided to the parent thread in response to the receipt of the join instruction.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the thread create instruction from the parent thread that indicates the number of return parameters uses two bits to indicate the number of return parameters.

### Claim 5 (depends on 1)

The apparatus of claim 1, wherein the reserving of the space in the memory comprises reserving 64 bits for each return parameter.

### Claim 6 (depends on 1)

The apparatus of claim 1, wherein the providing of the access to the return parameters from the reserved space to the parent thread comprises copying data from the reserved space to a register state of the parent thread.

### Claim 7 (depends on 1)

The apparatus of claim 1, wherein the operations further comprise:
in response to the thread return instruction, checking that all operations initiated by the child thread have either completed or been acknowledged.

### Claim 8 (depends on 1)

The apparatus of claim 1, wherein the operations further comprise:
waiting for all threads created by the child thread to complete before sending the thread return instruction from the child thread.

### Claim 9 (depends on 1)

The apparatus of claim 1, wherein the thread create instruction further indicates whether to start the child thread on a local node or a remote node.

### Claim 10 (depends on 1)

The apparatus of claim 1, wherein the creating of the child thread comprises:
beginning execution of the child thread from an address read from a register of the parent thread.

### Claim 11 (depends on 1)

The apparatus of claim 1, wherein:
the thread create instruction further indicates a number of call arguments; and
the call arguments are accessed from registers of the parent thread.

### Claim 12 (depends on 1)

The apparatus of claim 1, wherein:
the processing element is a hybrid threading processor.

### Claim 13

A non-transitory machine-readable medium that stores instructions that, when executed by a hybrid threading processor, cause the hybrid threading processor to perform operations comprising:
receiving a thread create instruction from a parent thread that indicates a number of return parameters to be generated by a child thread created by the thread create instruction;
reserving, based on the number of return parameters, space in a memory to store the return parameters;
creating the child thread based at least in part on the reserving of the space in the memory; and
providing access to the return parameters from the reserved space to the parent thread based at least in part on a thread return instruction from the child thread.

### Claim 14 (depends on 13)

The non-transitory machine-readable medium of claim 13, wherein:
the operations further comprise receiving a join instruction from the parent thread; and
the providing of the access to the return parameters from the reserved space to the parent thread is in response to the receipt of the join instruction.

### Claim 15 (depends on 13)

The non-transitory machine-readable medium of claim 13, wherein the thread create instruction from the parent thread that indicates the number of return parameters uses two bits to indicate the number of return parameters and selects one of 0, 1, 2, or 4 parameters.

### Claim 16 (depends on 13)

The non-transitory machine-readable medium of claim 13, wherein the reserving of the space in the memory comprises reserving 64 bits for each return parameter.

### Claim 17 (depends on 13)

The non-transitory machine-readable medium of claim 13, wherein the providing of the return parameters from the reserved space to the parent thread comprises copying data from the reserved space to a register state of the parent thread.

### Claim 18 (depends on 13)

The non-transitory machine-readable medium of claim 13, wherein the operations further comprise:
in response to the thread return instruction, checking that all operations initiated by the child thread have either completed or been acknowledged.

### Claim 19

A method comprising:
receiving, by a hybrid threading processor, a thread create instruction from a parent thread that indicates a number of return parameters to be generated by a child thread created by the thread create instruction;
reserving, by the hybrid threading processor, based on the number of return parameters, space in a memory to store the return parameters;
creating the child thread based at least in part on the reserving of the space in the memory; and
providing access to the return parameters from the reserved space to the parent thread based at least in part on a thread return instruction from the child thread.

### Claim 20 (depends on 19)

The method of claim 19, further comprising:
waiting for all threads created by the child thread to complete before sending the thread return instruction from the child thread.

### Claim 21 (depends on 19)

The method of claim 19, wherein the thread create instruction further indicates whether to start the child thread on a local node or a remote node.

### Claim 22 (depends on 19)

The method of claim 19, wherein the creating of the child thread comprises:
beginning execution of the child thread from an address read from a register of the parent thread.

### Claim 23 (depends on 19)

The method of claim 19, wherein:
the thread create instruction further indicates a number of call arguments; and
the call arguments are accessed from registers of the parent thread.
