# US 2019/0171453 A1 · Method for managing software threads dependent on condition variables

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

- Number: US 2019/0171453 A1
- Document ID: US20190171453A1
- Status: Published application
- Kind: A1
- Application number: 16/252,342
- Filed: 2019-01-18
- Published: 2019-06-06
- Earliest claimed: 2016-04-28
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Subhra Mazumdar
- Web page: https://patentgrep.com/patent/US20190171453A1

## CPC

- G06F 9/3009: {Thread control instructions}
- G06F 9/30079: {Pipeline control instructions, e.g. multicycle NOP}
- G06F 9/30094: {Condition code generation, e.g. Carry, Zero flag}
- G06F 9/3851: {from multiple instruction streams, e.g. multistreaming}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An apparatus includes a buffer, a sequencing circuit, and an execution unit. The buffer may be configured to store a plurality of instructions. Each of the plurality of instructions may be in a first thread. In response to determining that the first instruction depends on the value of a condition variable and to determining that a count value is below a predetermined threshold, the sequencing circuit may be configured to add a wait instruction before the first instruction. The execution unit may be configured to delay execution of the first instruction for an amount of time after executing the wait instruction. The sequencing circuit may be further configured to maintain the plurality of instructions in the first buffer after executing the wait instruction, and to decrement the count value in response to determining that the value of the condition variable is updated within the amount of time.

## Claims

### Claim 1

An apparatus, comprising:
a control circuit configured to:
store, in a pick queue, a plurality of instructions included in a first thread of a plurality of threads, wherein a first instruction of the plurality of instructions depends on an update to a condition variable; and
based on a number of times the condition variable has failed to update within a particular amount of time, selectively add a wait instruction to the pick queue before the first instruction; and
an execution unit configured to delay execution of the first instruction for the particular amount of time in response to executing the wait instruction; and
wherein the control circuit is further configured to, in response to a determination that the condition variable is not updated during the particular amount of time, modify a count value that is indicative of the number of times the condition variable has failed to update within the particular amount of time.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the control circuit is further configured to add a sleep instruction to the pick queue before the first instruction in response to the determination that the condition variable is not updated during the particular amount of time.

### Claim 3 (depends on 2)

The apparatus of claim 2, wherein the control circuit is further configured to move the plurality of instructions of the first thread from the pick queue to a sleep buffer in response to an execution of the sleep instruction.

### Claim 4 (depends on 3)

The apparatus of claim 3, wherein the control circuit is further configured to move a plurality of instructions included in a second thread of the plurality of threads to the pick queue in response to the move of the plurality of instructions of the first thread.

### Claim 5 (depends on 4)

The apparatus of claim 4, wherein the execution unit is further configured to execute one or more instructions of the second thread.

### Claim 6 (depends on 3)

The apparatus of claim 3, wherein the execution unit is further configured to:
move the plurality of instructions of the first thread from the sleep buffer back to the pick queue in response to a determination that the condition variable has been updated; and
execute one or more instructions of the first thread.

### Claim 7 (depends on 1)

The apparatus of claim 1, wherein the condition variable is configured to be updated in response to receiving data via a network interface.

### Claim 8

A method comprising:
storing in a pick queue, by a control circuit, a plurality of instructions included in a first thread of a plurality of threads, wherein a first instruction of the plurality of instructions depends on an update to a condition variable;
based on a number of times the condition variable has failed to update within a particular amount of time, suspending, by an execution unit, execution of the first instruction for the particular amount of time; and
incrementing, by the control circuit, a count value in response to determining that the condition variable is not updated within the particular amount of time; and
wherein the count value is indicative of the number of times the condition variable has failed to update within the particular amount of time.

### Claim 9 (depends on 8)

The method of claim 8, further comprising executing, by the execution unit, one or more instructions from a second thread of the plurality of threads while execution of the first instruction of the first thread is suspended.

### Claim 10 (depends on 8)

The method of claim 8, further comprising adding, by the control circuit, a sleep instruction to the pick queue before the first instruction in response to determining that the condition variable is not updated within the particular amount of time.

### Claim 11 (depends on 10)

The method of claim 10, further comprising moving, by the control circuit, the plurality of instructions of the first thread from the pick queue to a sleep buffer in response to executing, by the execution unit, the sleep instruction.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
moving, by the control circuit, a plurality of instructions included in a second thread of the plurality of threads to the pick queue in response to the move of the plurality of instructions of the first thread; and
executing, by the execution unit, one or more instructions of the second thread.

### Claim 13 (depends on 11)

The method of claim 11, further comprising:
moving, by the control circuit, the plurality of instructions of the first thread from the sleep buffer back to the pick queue in response to determining that the condition variable has been updated; and
executing, by the execution unit, one or more instructions of the first thread.

### Claim 14 (depends on 8)

The method of claim 8, further comprising updating the condition variable in response to receiving input from a user interface.

### Claim 15

An apparatus, comprising:
a control circuit configured to store, in a pick queue, a plurality of instructions included in a first thread of a plurality of threads, wherein a first instruction of the plurality of instructions depends on an update to a condition variable; and
an execution unit configured to, based on a number of times the condition variable has failed to update within a particular amount of time, suspend execution of the first instruction for the particular amount of time; and
wherein the control circuit is further configured park the first thread in response to a determination that the condition variable is not updated within the particular amount of time.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein to suspend the execution of the first instruction, the control circuit is further configured to determine that a count value is less than a threshold value.

### Claim 17 (depends on 16)

The apparatus of claim 16, wherein the control circuit is further configured to increment the count value in response to a determination that the condition variable is not updated within the particular amount of time.

### Claim 18 (depends on 15)

The apparatus of claim 15, wherein to suspend the execution of the first instruction, the control circuit is further configured to insert a wait instruction in the pick queue before the first instruction.

### Claim 19 (depends on 15)

The apparatus of claim 15, wherein to park the first thread, the control circuit is further configured to move the plurality of instructions of the first thread from the pick queue to a sleep buffer.

### Claim 20 (depends on 15)

The apparatus of claim 15, wherein the condition variable is configured to be updated in response to a measurement in a sensor circuit reaching a particular value.
