Atomically moving data elements between or within linked data structures
First Claim
1. A system, comprising:
- one or more processors;
a memory coupled to said one or more processors, said memory including a computer usable medium storing at least one program of instructions executable by said processor to perform operations for atomically moving a data element of a linked data structure without delaying lockless readers that reference said data element without using locks, said operations comprising;
allocating a status-indicating entity if one does not already exist and associating it with said data element in a manner that allows said status-indicating entity to be referenced from said data element by said lockless readers, said data element being linked to a first linked data structure that said lockless readers can traverse in order to reference said data element;
copying said data element, or a pointer thereto, to create a copy element that is to be linked to a second linked data structure;
associating said status-indicating entity with said copy element in a manner that allows said status-indicating entity to be referenced from said copy element by said lockless readers;
linking said copy element to said second linked data structure that said lockless readers can traverse in order to reference said copy element;
said status-indicating entity initially indicating to said lockless readers that said data element has validity with respect to said first linked data structure and said copy element has no validity with respect to said second linked data structure;
atomically updating said status-indicating entity to indicate to said lockless readers that said data element has no validity with respect to said first linked data structure and said copy element has validity with respect to said second linked data structure;
deleting said data element from said first linked data structure and deallocating it in a deferred manner that guarantees none of said lockless readers will be referencing said data element at the time of deallocation; and
disassociating said status-indicating entity from said copy element, and if no longer needed, deallocating it in a deferred manner that guarantees none of said lockless readers will be referencing said status-indicating entity at the time of deallocation.
1 Assignment
0 Petitions
Accused Products
Abstract
A data element of a linked data structure is atomically moved without delaying lockless readers. A status-indicating entity is allocated, associated with the data element, and indicates validity of the data element with respect to the first linked data structure. A copy element, or a pointer thereto, is created from the data element. The status-indicating entity is associated with the copy element and indicates no validity of the copy element with respect to a second linked data structure. The copy element is linked to the second linked data structure. The status-indicating entity is atomically updated to indicate no validity of the data element with respect to the first linked data structure and validity of the copy element with respect to the second linked data structure. The data element is deleted and the status-indicating entity is disassociated from the copy element. Both structures may be deallocated in a deferred reader-friendly manner.
16 Citations
13 Claims
-
1. A system, comprising:
-
one or more processors; a memory coupled to said one or more processors, said memory including a computer usable medium storing at least one program of instructions executable by said processor to perform operations for atomically moving a data element of a linked data structure without delaying lockless readers that reference said data element without using locks, said operations comprising; allocating a status-indicating entity if one does not already exist and associating it with said data element in a manner that allows said status-indicating entity to be referenced from said data element by said lockless readers, said data element being linked to a first linked data structure that said lockless readers can traverse in order to reference said data element; copying said data element, or a pointer thereto, to create a copy element that is to be linked to a second linked data structure; associating said status-indicating entity with said copy element in a manner that allows said status-indicating entity to be referenced from said copy element by said lockless readers; linking said copy element to said second linked data structure that said lockless readers can traverse in order to reference said copy element; said status-indicating entity initially indicating to said lockless readers that said data element has validity with respect to said first linked data structure and said copy element has no validity with respect to said second linked data structure; atomically updating said status-indicating entity to indicate to said lockless readers that said data element has no validity with respect to said first linked data structure and said copy element has validity with respect to said second linked data structure; deleting said data element from said first linked data structure and deallocating it in a deferred manner that guarantees none of said lockless readers will be referencing said data element at the time of deallocation; and disassociating said status-indicating entity from said copy element, and if no longer needed, deallocating it in a deferred manner that guarantees none of said lockless readers will be referencing said status-indicating entity at the time of deallocation. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer program product, comprising:
-
one or more computer-readable storage media; program instructions stored on said one or more storage media for programming a data processing platform having one or more processors operatively coupled to a memory to perform operations for atomically moving a data element of a linked data structure without delaying lockless readers that reference said data element without using locks, said operations comprising; allocating a status-indicating entity if one does not already exist and associating it with said data element in a manner that allows said status-indicating entity to be referenced from said data element by said lockless readers, said data element being linked to a first linked data structure that said lockless readers can traverse in order to reference said data element; copying said data element, or a pointer thereto, to create a copy element that is to be linked to a second linked data structure; associating said status-indicating entity with said copy element in a manner that allows said status-indicating entity to be referenced from said copy element by said lockless readers; linking said copy element to said second linked data structure that said lockless readers can traverse in order to reference said copy element; said status-indicating entity initially indicating to said lockless readers that said data element has validity with respect to said first linked data structure and said copy element has no validity with respect to said second linked data structure; atomically updating said status-indicating entity to indicate to said lockless readers that said data element has no validity with respect to said first linked data structure and said copy element has validity with respect to said second linked data structure; deleting said data element from said first linked data structure and deallocating it in a deferred manner that guarantees none of said lockless readers will be referencing said data element at the time of deallocation; and disassociating said status-indicating entity from said copy element, and if no longer needed, deallocating it in a deferred manner that guarantees none of said lockless readers will be referencing said status-indicating entity at the time of deallocation. - View Dependent Claims (9, 10, 11, 12, 13)
-
Specification