Dynamic allocation of a pool of threads
AssigneeSun Microsystems, Inc.
InventorsCahya Adi Masputra, Kacheong Poon
Life of this patent
Estimating the term…
Abstract
Embodiments of the present invention provide for execution of a protocol in a multi-processor network device. In one embodiment, a hash function is applied to one or more fields of the data packet header to determine a unique index. A hash table is then queried, whereby data indicating one or more threads corresponding to said unique index is extracted. An available thread of execution, which has previously handled packet in the same receive stream, may thus be selected from a pool of threads. The selected thread of execution is then dispatched to provide for receive processing of the present data packet.
Claims19
A network device comprising:
- an interface module communicatively coupled to a network for acquiring a data packet over the network;
- a pool of a plurality of threads of execution for processing said data packet;
- and
- a dynamic pool allocator for selectively dispatching one of the plurality of threads of execution from said pool, wherein said dynamic pool allocator hashes a header of said data packet to determine a hash index, which is utilized by said dynamic pool allocator to select said one of the plurality of threads of execution from said pool, said dynamic pool allocator dispatching an available thread of execution from said pool, when said hash index does not have a corresponding thread from said pool in a hash table of said dynamic pool allocator, said hash table correlating one of a plurality of hash indexes to one or more threads of said pool of threads, adding another record to said hash table, and said added record comprising said hash index and said allocated thread of execution.
A network communication receive process comprising:
- acquiring a data packet over a network;
- selectively dispatching a thread of execution from a pool of threads by hashing a header of said data packet to determine a hash index by a dynamic pool allocator, wherein the hash index is utilized by said dynamic pool allocator to select said thread of execution, said dynamic pool allocator dispatching an available thread of execution from said pool, when said hash index does not have a corresponding thread from said pool in a hash table of said dynamic pool allocator, said hash table correlating one of a plurality of hash indexes to one or more threads of the pool of threads, adding another record to said hash table, and said added record comprising said hash index and said allocated thread of execution;
- processing said header of said data packet utilizing said thread of execution;
- and
- delivering a payload of said data packet to a destination application according to said processing said header.
A method of providing for execution of a protocol in a network comprising:
- applying a hash function to one or more fields in a header of a data packet, wherein a hash index is determined;
- querying a hash table, wherein each of a plurality of records in the hash table correlates one of a plurality of hash indexes to one or more of a plurality of threads of execution;
- selecting an available thread of execution from said one or more of said plurality of threads of execution corresponding to said hash index;
- dispatching said available thread of execution;
- allocating an available thread of execution from said plurality of threads of execution to dispatch, when said hash index does not have a corresponding thread of said plurality of threads of execution in said hash table;
- and
- adding another record to said hash table, wherein said record comprises said hash index and said allocated thread of execution.
Dependencies are inferred from the claim text.