System and method for providing a pool of reusable threads for performing queued items of work
AssigneeUnisys Corporation
InventorsJames A. Sievert, Mark K. Vallevand
Life of this patent
Estimating the term…
Abstract
A system and method for managing a pool of threads for executing thread operations. A thread pool is instantiated which includes a plurality of threads, and a work queue having program controllable states is instantiated. Thread operations are queued to the work queue when the work queue is in a running or suspended state, and when the work queue is in a stopped state requests to queue thread operations are denied. The work queue supports controlled allocation of thread resources to a variety of thread operations.
Claims11
A computer-implemented method for managing a pool of threads for executing thread operations, comprising:
- instantiating a thread pool having a plurality of threads;
- instantiating a work queue having a program controllable state;
- queuing thread operations to the work queue for execution by threads in the thread pool when the work queue is in a running state and when the work queue is in a suspended state;
- denying queuing of thread operations to the work queue when the work queue is in a stopped state;
- repeating by each thread steps of dequeueing a thread operation and executing the thread operation when the work queue is in the running state;
- and
- ceasing to dequeue thread operations when the work queue is in the suspended state.
A computer-implemented method for managing execution of thread operations, comprising:
- instantiating a plurality of thread pools, each including an associated plurality of threads;
- instantiating a plurality of work queues, each having a program controllable state and associated with one of the thread pools;
- queuing thread operations to the work queues for execution by threads in the associated thread pools, wherein thread operations arc queueable to a work queue when the work queue is in a running state and when the work queue is in a suspended state;
- denying queuing of thread operations to a work queue when the work queue is in a stopped state;
- and
- repeating by each thread in a thread pool steps of dequeueing a thread operation from the associated work queue and executing the thread operation when the work queue is in a running state;
- and
- ceasing to dequeue thread operations from a work queue when the work queue is in the suspended state.
An apparatus for managing a pool of threads for executing thread operations, comprising:
- means for instantiating a thread pool having a plurality of threads;
- means for instantiating a work queue having a program controllable state;
- means for queuing thread operations to the work queue for execution by threads in the thread pool when the work queue is in a running state and when the work queue is in a suspended state;
- means for denying queuing of thread operations to the work queue when the work queue is in a stopped state;
- means for dequeueing thread operations and executing the thread operations by the threads when the work queue is in the running state;
- and
- means for ceasing to dequeue thread operations when the work queue is in the suspended state.
A system for managing a pool of threads for executing thread operations, comprising:
- a thread pool object having a plurality of thread objects;
- a work queue object having a program controllable state;
- a work queue controller coupled to the work queue object and to the thread pool object, the work queue controller configured and arranged to queue thread operations to the work queue object for execution when the work queue object is in a running state and when the work queue is in a suspended state and deny queuing of a thread operation to the work queue object when the work queue object is in a stopped state;
- a thread pool manager coupled to the work queue controller, the thread pool manager configured and arranged to selectively change states of the work queue object;
- wherein each of the thread objects is configured and arranged to dequeue thread operations and execute the thread operations, and the work queue controller is configured to cease dequeueing thread operations when the work queue is in the suspended state.
Dependencies are inferred from the claim text.