×

Data structure for efficient enqueuing and dequeuing

  • US 7,310,649 B1
  • Filed: 09/30/2000
  • Issued: 12/18/2007
  • Est. Priority Date: 05/15/2000
  • Status: Expired due to Fees
First Claim
Patent Images

1. A method implemented at least in part by a computing device for adding a new entity having a rank within a plurality of N ranks to a plurality of entities as represented in a data structure for efficiently ordering the entities, the entities also having respective ranks within the plurality of N ranks, the method comprising:

  • of a plurality of array entries of an array having fewer than N entries over which the plurality of N ranks are distributed, such that the array entries correspond to respective ranges of ranks, determining a particular array entry corresponding to a range of ranks in which the rank of the new entity lies;

    adjusting the particular array entry to point to the new entity in response to determining that the particular array entry currently points to null;

    adjusting the particular array entry to point to the new entity in response to determining that the particular array entry currently points to an entity having a rank less than the rank of the new entity;

    linking the new entity into a vertically linked list linking in at least one direction a corresponding subset of the plurality of entities having an identical rank, in response to determining that the rank of the new entity is equal to the rank of any other entity within the plurality of entities for a respective range of ranks associated with an array entry; and

    otherwise, linking the new entity into a horizontally linked list linking at least a subset of the plurality of entities in at least a descending rank order direction, the entities in the horizontally linked list having unique ranks as compared to the ranks of other entities in the horizontally linked list that spreads over the plurality of ranges of the array, wherein at least one entity of the plurality of entities is a thread, the rank of the entity is a priority for the thread, and the array is a priority queue.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×