Method for implementing a queue in a memory, and memory arrangement
First Claim
1. A method for implementing a queue in a memory (MEM) in which data is stored as data units for each of which a dedicated storage space is assigned in the memory, in accordance with which method data units are added to and deleted from the queue,characterized in that at least part of the queue is implemented as a tree-shaped data structure (A, B) known per se, having nodes at several different hierarchy levels, wherein an individual node can be (i) an internal node containing at least one pointer pointing to a node lower in the tree-shaped hierarchy or (ii) a leaf node containing at least one pointer to a data unit stored in the memory, wherein the node at the highest level of the structure is the root node of the structure, and wherein in connection with the addition of a data unit a pointer pointing to said data unit is added to a leaf node and in connection with a deletion the pointer pointing to the data unit is deleted from a leaf node, a given maximum number of pointers that an individual node can contain is defined for the nodes, an individual node being full when it has said maximum number of pointers and non-full in other cases, the additions to be made to said part are directed in the tree-shaped data structure to the first non-full node, seen from below, on a predetermined first edge of the data structure and they are further implemented in such a way that the leaf nodes remain at the same hierarchy level of the tree-shaped data structure, wherein when a non-full node is not present, new nodes are created to keep the leaf nodes at the same hierarchy level, and the deletions to be made from said part are directed to the leaf node on the predetermined other edge of the tree.
9 Assignments
0 Petitions
Accused Products
Abstract
The invention relates to a method for implementing a queue, particularly a FIFO queue, in a memory (MEM) and to a memory arrangement. In order to enable reducing the amount of copying particularly in a functional environment, at least part of the queue is formed with a tree-shaped data structure (A, B) known per se, having nodes at several different hierarchy levels, wherein an individual node can be (i) an internal node (N1-N3) containing at least one pointer pointing to a node lower in the tree-shaped hierarchy or (ii) a leaf node (N4-N6) containing at least one pointer to data unit (1 . . . 6) stored in the memory or at least one data unit. A given maximum number of pointers that an individual node can contain is defined for the nodes. The additions to be made to said part are directed in the tree-shaped data structure to the first non-full node (N4), seen from below, on a predetermined first edge of the data structure and they are further implemented in such a way that the leaf nodes remain at the same hierarchy level of the tree-shaped data structure, wherein when a non-full node is not present, new nodes are created to maintain the leaf nodes at the same hierarchy level. The deletions to be made from said part are typically directed to the leaf node on the opposite edge of the tree.
26 Citations
17 Claims
-
1. A method for implementing a queue in a memory (MEM) in which data is stored as data units for each of which a dedicated storage space is assigned in the memory, in accordance with which method data units are added to and deleted from the queue,
characterized in that at least part of the queue is implemented as a tree-shaped data structure (A, B) known per se, having nodes at several different hierarchy levels, wherein an individual node can be (i) an internal node containing at least one pointer pointing to a node lower in the tree-shaped hierarchy or (ii) a leaf node containing at least one pointer to a data unit stored in the memory, wherein the node at the highest level of the structure is the root node of the structure, and wherein in connection with the addition of a data unit a pointer pointing to said data unit is added to a leaf node and in connection with a deletion the pointer pointing to the data unit is deleted from a leaf node, a given maximum number of pointers that an individual node can contain is defined for the nodes, an individual node being full when it has said maximum number of pointers and non-full in other cases, the additions to be made to said part are directed in the tree-shaped data structure to the first non-full node, seen from below, on a predetermined first edge of the data structure and they are further implemented in such a way that the leaf nodes remain at the same hierarchy level of the tree-shaped data structure, wherein when a non-full node is not present, new nodes are created to keep the leaf nodes at the same hierarchy level, and the deletions to be made from said part are directed to the leaf node on the predetermined other edge of the tree.
-
8. A method for implementing a queue in a memory (MEM) in which data is stored as data units for each of which a dedicated memory space is assigned in the memory, in accordance with which method data units are added to and deleted from the memory,
characterized in that at least part of the queue is implemented as a tree-shaped data structure known per se, having nodes at several different hierarchy levels, wherein an individual node can be (i) an internal node containing at least one pointer pointing to a node lower in the tree-shaped hierarchy or (ii) a leaf node containing at least one data unit, wherein the node at the highest level of the structure is the root node of the structure and wherein the data unit is added to and deleted from a leaf node, a given maximum number of pointers for the internal nodes and a given maximum number of data units for the leaf nodes that an individual node can contain is defined, an individual node being full when it has said maximum number of pointers or data units and non-full in other cases, the additions to be made to said part are directed in the tree-shaped data structure to the first non-full node, seen from below, on a predetermined first edge of the data structure and they are further implemented in such a way that the leaf nodes remain at the same hierarchy level of the tree-shaped data structure, wherein when a non-full node is not present, new nodes are created to keep the leaf nodes at the same hierarchy level, and the deletions to be made from said part are directed to the leaf node on the predetermined other edge of the tree.
-
15. A memory arrangement for implementing a queue, said queue comprising memory units stored in the memory and said arrangement including
a tree-shaped data structure stored in the memory, having nodes at several different hierarchy levels, wherein an individual node can be (i) an internal node containing at least one pointer pointing to a node lower in the tree-shaped hierarchy or (ii) a leaf node containing at least one pointer to a data unit stored in the memory or at least one data unit, the node at the highest level of the structure being the root node of the structure, characterized in that each node contains at most a given predetermined maximum number of pointers or data units, a node being full when it has said maximum number of pointers or data units, and that all nodes of the tree-shaped data structure are full except for the nodes on the edges of the structure, and that all leaf nodes of the tree-shaped data structure are continually at the same hierarchy level, wherein the pointers or data units contained in the leaf nodes form at least part of the queue.
Specification