US 11,789,741 B2
Determining an optimum quantity of interleaved instruction streams of defined coroutines
Georgios Psaropoulos, Lausanne (CH); Thomas Legler, Walldorf (DE); Norman May, Karlsruhe (DE); and Anastasia Ailamaki, Morges (CH)
Assigned to SAP SE, Walldorf (DE)
Filed by SAP SE, Walldorf (DE)
Filed on Mar. 8, 2018, as Appl. No. 15/915,787.
Prior Publication US 2019/0278608 A1, Sep. 12, 2019
Int. Cl. G06F 9/38 (2018.01); G06F 9/30 (2018.01)
CPC G06F 9/3851 (2013.01) [G06F 9/30047 (2013.01)] 15 Claims
OG exemplary drawing
 
1. A database system, comprising:
at least one data processor; and
at least one memory storing instructions which, when executed by the at least one data processor, cause the database system to at least:
determine an optimum quantity of instruction streams to interleave such that at least one stall is eliminated due to a cache miss causing a fetch from a main memory, the optimum quantity of instruction streams determined based on at least a ratio of a target time to a sum of a compute time corresponding to a duration of one or more computation stages during which instruction streams execute and a switch time corresponding to a quantity of time to switch between instruction streams, wherein the target time is a difference between a stall time corresponding to the cache miss and the switch time; and
interleave, based on the determined optimum quantity of instruction streams, an execution of instruction streams, wherein the execution of the interleaved instruction streams comprises:
performing a first database operation by at least executing a first instruction stream associated with the first database operation, the first database operation being defined in code as a coroutine to at least enable the execution of the first instruction stream to be suspended and resumed;
in response to determining that data required to continue the execution of the first instruction stream of the coroutine is absent from a cache, suspending the execution of the first instruction stream of the coroutine;
switching to perform a second database operation by at least executing a second instruction stream associated with the second database operation, the executing of the second instruction stream performed before resumption of the execution of the first instruction stream of the coroutine, wherein the second instruction stream is interleaved with the execution of the first instruction stream;
executing the second instruction stream while the data required to continue the execution of the first instruction stream is being fetched from the main memory; and
in response to determining that the data required to continue the execution of the first instruction stream has been fetched from the main memory, resuming the execution of the first instruction stream.