US 12,189,605 B1
Controlling concurrently executing threads
Tobias Scheuer, Bruchsal (DE); and Mathias Gottschlag, Altrip (DE)
Assigned to SAP SE, Walldorf (DE)
Filed by SAP SE, Walldorf (DE)
Filed on Jul. 6, 2023, as Appl. No. 18/347,773.
Int. Cl. G06F 16/23 (2019.01)
CPC G06F 16/2315 (2019.01) [G06F 16/2365 (2019.01)] 14 Claims
OG exemplary drawing
 
1. A computer-implemented method for controlling parallel processing of tasks at a database management system, the method comprising:
executing, by at least one processor, a first task at a first thread from a pool of threads for execution of tasks at the database management system;
identifying that the execution of the first task is paused and that the first task is in a sleep mode;
in response to identifying that the first task is in an awake mode after the sleep mode, determining, by the at least one processor, whether a current number of threads in the pool that is currently processing the tasks in parallel is below an allowed number of threads;
in response to determining that the current number of threads in the pool that is currently processing the tasks in parallel is at or above the allowed number of threads, assigning a waiting status to the first task at the first thread;
establishing, by the at least one processor, a queue of the tasks to be executed at the pool of threads, where the tasks from the queue are consecutively provided for parallel or sequential execution at one or more threads of the pool, wherein the queue is maintained to store first objects associated with tasks awaitinq execution at a thread in the pool of threads, and wherein the queue stores second objects associated with tasks that are already started at a thread in the pool and are in a sleep mode, wherein the second objects are different from the first objects, and the second objects are stored with a higher priority in the queue than the first objects; and
when a task of the tasks from the queue is executed at a thread in the pool, invoking, by the at least one processor, an object of the first objects or second objects from the queue for execution at a thread in the pool.