IP Library Granted Patent US 8,239,872
Granted Patent B2
US 8,239,872 · App. 12/314,481 · Granted Aug 7, 2012

Method and system for controlling distribution of work items to threads in a server

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,239,872
App. No.
12/314,481
Granted
Aug 7, 2012
Kind
B2
Abstract

A system and method are presented to control distribution of work items to threads in a server. The system and method include a permit dispenser that keeps track of permits, and a plurality of thread pools each including a queue with a configurable size, being configured with a desired concurrency and a size of the queue that is equal to a total number of work items to be executed by pool threads in the thread pool. The number of permits specifies a total number of threads available for executing the work items in the server. Each pool thread executes a work item in the thread pool, determines whether a thread surplus or a thread deficit exists, and shrinks or grows the thread pool respectively.

Claims (32)

1. A computer-implemented system for controlling distribution of work items to

threads in a server, comprising: hardware computer processor to execute:

a permit dispenser that keeps track of permits, a number of permits specifying a total number of threads available for executing the work items in the server;

a workflow authoring component that determines a desired concurrency, wherein the desired concurrency is equal to a maximum number of work items that can be executed in parallel;

a thread pool manager to manage one or more thread pools and to request a number of permits equal to the desired concurrency; and wherein if no permits are available, a calling thread to: determine if work permits are available; if no work permits are available, execute one work item and re-request from the permit dispenser the number of permits that is equal to a lesser of the desired concurrency and a number of remaining unexecuted work items.

2. The system of claim 1 , wherein if the system obtains one or more permits, the thread pool manager is arranged to create thread pool that comprises:

the one or more pool threads, wherein a number of the one or more pool threads is equal to an initial concurrency that is equal to a number of permits obtained from the permit dispenser and a queue size that is equal to a total number of work items in a set of work items the thread pool is to execute.

3. The system of claim 1 , wherein a thread surplus exists when a number of pool

threads in the thread pool is more than a number of remaining unexecuted work items.

4. The system of claim 3 , wherein if the thread surplus exists, the pool thread is arranged to return the permit to the permit dispenser and terminate, thereby shrinking the thread pool.

5. The system of claim 1 , wherein a thread deficit exists when a number of pool

threads working on the work items in the thread pool is less than both the desired

concurrency and a number of remaining unexecuted work items.

6. The system of claim 5 , wherein if the thread deficit is greater than zero, the pool thread is arranged to request a number of permits from the permit dispenser that is equal to the thread deficit.

7. The system of claim 6 , wherein the pool thread is arranged to add acquired new pool threads to the thread pool.

8. The system of claim 1 , wherein the thread pool manager ensures that each pool thread in the thread pool executes work items without relying on another pool thread in a same thread pool to complete a sub-item, and wherein the sub-item is executed by threads in a different thread pool, thereby preventing a deadlock.

9. A method for controlling distribution of work items to threads in a server, the method being implemented by a computer including a processor and a memory, comprising:

using the processor to provide a permit dispenser that keeps track of a plurality of permits, a number of the plurality of permits specifying a total number of threads available for executing the work items in the server;

determining a desired concurrency, using the processor, the desired concurrency being equal to a maximum number of work items enabled to execute in parallel; and

creating a plurality of thread pools stored in the memory using the processor; the thread pool manager requesting a number of permits equal to the desired concurrency; and

if no permits are available, executing, using the processor, one work item and re-requesting from the permit dispenser the number of permits equal to a lesser of the desired concurrency and the number of remaining unexecuted work items.

10. The method of claim 9 , wherein a thread surplus exists when a number of pool threads in the thread pool is more than a number of remaining unexecuted work items.

11. The method of claim 10 , further comprising if the thread surplus exists, the pool thread returning the permit to the permit dispenser and terminating, thereby shrinking the thread pool.

12. The method of claim 9 , wherein a thread deficit exists when a number of pool threads working on the work items in the thread pool is less than both the desired concurrency and a number of remaining unexecuted work items.

13. The method of claim 12 , further comprising:

if the thread deficit is greater than zero, the pool thread requesting a number of permits from the permit dispenser that is equal to the thread deficit; and

adding newly acquired pool threads to the thread pool.

14. A non-transitory computer readable medium providing instructions for controlling distribution of work items to threads in a server, the instructions, if executed, causes a processor to:

provide a permit dispenser to keep track of a plurality of permits, a number of the plurality of permits specifying a total number of threads available for executing work items in a server;

provide a workflow authoring component to determine a desired concurrency, the desired concurrency being equal to a maximum number of work items that can be executed in parallel; and

use a thread pool manager to create a plurality of thread pools stored in a memory and to request a number of permits equal to the desired concurrency; and

if no permits are available, execute one work item and re-request from the permit dispenser the number of permits equal to a lesser of the desired concurrency and the number of remaining unexecuted work items.

Assignments (8)
RELEASE OF SECURITY INTEREST REEL/FRAME 044183/0577 Recorded Feb 2, 2023
From: JPMORGAN CHASE BANK, N.A.
To: MICRO FOCUS LLC (F/K/A ENTIT SOFTWARE LLC)
Reel/Frame 063560/0001 →
RELEASE OF SECURITY INTEREST REEL/FRAME 044183/0718 Recorded Feb 2, 2023
From: JPMORGAN CHASE BANK, N.A.
To: MICRO FOCUS LLC (F/K/A ENTIT SOFTWARE LLC); BORLAND SOFTWARE CORPORATION; MICRO FOCUS (US), INC.; SERENA SOFTWARE, INC; ATTACHMATE CORPORATION; MICRO FOCUS SOFTWARE INC. (F/K/A NOVELL, INC.); NETIQ CORPORATION
Reel/Frame 062746/0399 →
CHANGE OF NAME Recorded Aug 8, 2019
From: ENTIT SOFTWARE LLC
To: MICRO FOCUS LLC
Reel/Frame 050004/0001 →
SECURITY INTEREST Recorded Oct 11, 2017
From: ENTIT SOFTWARE LLC; ATTACHMATE CORPORATION; BORLAND SOFTWARE CORPORATION; NETIQ CORPORATION; MICRO FOCUS (US), INC.; MICRO FOCUS SOFTWARE, INC.; ARCSIGHT, LLC; SERENA SOFTWARE, INC.
To: JPMORGAN CHASE BANK, N.A.
Reel/Frame 044183/0718 →
SECURITY INTEREST Recorded Oct 11, 2017
From: ENTIT SOFTWARE LLC; ARCSIGHT, LLC
To: JPMORGAN CHASE BANK, N.A.
Reel/Frame 044183/0577 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 9, 2017
From: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP
To: ENTIT SOFTWARE LLC
Reel/Frame 042746/0130 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 9, 2015
From: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
To: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP
Reel/Frame 037079/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 11, 2008
From: TATU, SERBAN
To: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
Reel/Frame 022028/0902 →