Worker thread manager
AssigneeSap SE
InventorJohnson Wong
Life of this patent
Estimating the term…
Abstract
A system includes determination of whether a current number of active worker threads of a client application is less than a maximum active worker thread limit, retrieval, if the number of active worker threads is less than the maximum active worker thread limit, of a first job associated with a first context from a job pool, determination of whether an inactive worker thread is associated with the first context, and, if an inactive worker thread is associated with the first context, execution of the first job on the inactive worker thread.
Claims12
A device comprising:
- a memory storing processor-executable process steps;
- and
- a processor to execute processor-executable process steps to:
- receive at least a first job having a first type;
- determine whether a current number of worker threads of a client application is less than a maximum worker thread limit, wherein a worker thread is adapted to execute a job;
- upon determining that the current number of worker threads is less than the maximum worker thread limit:
- (a) create a first worker thread adapted to execute the first job, wherein the first worker thread is tied to a first context capable of performing the first job, (b) assign an available worker thread to the first job, wherein the available worker thread is tied to the first context capable of performing the first job;
- and
- execute the first job with the worker thread;
- upon determining that the current number of worker threads is the maximum worker thread limit:
- determine an available worker thread for the first job;
- assign the available worker thread to the first job;
- and
- execute the first job on the available worker thread;
- and
- upon determining the current number of worker threads is the maximum worker thread limit and a worker thread is not available for assignment to the first job:
- prune one or more inactive worker threads;
- create a first worker thread associated with the first context;
- and
- execute the first job on the first worker thread.
A computer-implemented method comprising:
- determining whether a current number of worker threads of a client application is less than a maximum worker thread limit, wherein a worker thread is adapted to execute a job;
- upon determining that the current number of worker threads is less than the maximum worker thread limit:
- (a) creating a first worker thread adapted to execute the first job, wherein the first worker thread is tied to a first context capable of performing the first job, (b) assigning an available worker thread to the first job, wherein the available worker thread is tied to the first context capable of performing the first job;
- and
- executing the first job with the worker thread;
- upon determining that the current number of worker threads is the maximum worker thread limit, determining an available worker thread for the first job, and assigning the available worker thread to the first job;
- and
- upon determining the current number of worker threads is the maximum worker thread limit and a worker thread is not available for assignment to the first job,
- pruning one or more inactive worker threads, creating a first worker thread associated with the first context, and executing the first job on the first worker thread.
A non-transitory computer-readable medium storing computer-executable process steps which, when executed by a computing device, provide a web worker manager to:
- receive a first instruction from a client application to register a first context;
- receive a second instruction from the client application to enqueue a first job associated with the first context, wherein the first context is capable of performing the first job;
- in response to the second instruction, enqueue the first job in a job pool;
- determine whether a current number of worker threads of the client application is less than a maximum worker thread limit, wherein a worker thread is adapted to execute a job;
- upon determining that the number of worker threads is less than the maximum worker thread limit:
- (a) create a first worker thread adapted to execute the first job, wherein the first worker thread is tied to a first context capable of performing the first job, (b) assign an available worker thread to the first job, wherein the available worker thread is tied to the first context capable of performing the first job;
- and
- execute the first job with the worker thread;
- upon determining that the number of worker threads is the maximum worker thread limit:
- determine an available worker thread for the first job;
- assign the available worker thread to the first job;
- and
- execute the first job on the available worker thread;
- and
- upon determining the current number of worker threads is the maximum worker thread limit and a worker thread is not available for assignment to the first job:
- prune one or more inactive worker threads;
- create a first worker thread associated with the first context;
- and
- execute the first job on the first worker thread.
Dependencies are inferred from the claim text.