Method for efficient implementation of dynamic lock-free data structures with safe memory reclamation
First Claim
1. A computer-implemented method for managing a shared, lock-free dynamic data structure in a multithreaded operating environment, comprising the steps of:
- setting a hazard pointer to an address of a portion of a data structure to be removed;
removing the portion of the data structure; and
ensuring that memory associated with the removed portion of the data structure is freed only when the hazard pointer no longer points to the removed portion of the data structure.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for safe memory reclamation for dynamic lock-free data structures employs a plurality of shared pointers, called hazard pointers, that are associated with each participating thread. Hazard pointers either have null values or point to nodes that may potentially be accessed by a thread without further verification of the validity of the local references used in their access. Each hazard pointer can be written only by its associated thread, but can be read by all threads. The method requires target lock-free algorithms to guarantee that no thread can access a dynamic node at a time when it is possibly unsafe (i.e., removed from the data structure), unless one or more of its associated hazard pointers has been pointing to the node continuously, from a time when it was not removed.
-
Citations
19 Claims
-
1. A computer-implemented method for managing a shared, lock-free dynamic data structure in a multithreaded operating environment, comprising the steps of:
-
setting a hazard pointer to an address of a portion of a data structure to be removed;
removing the portion of the data structure; and
ensuring that memory associated with the removed portion of the data structure is freed only when the hazard pointer no longer points to the removed portion of the data structure. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A program storage device readable by a machine, tangibly embodying a program of instructions executable on the machine to perform method steps for managing a shared dynamic data structure in a multithreaded operating environment, the method steps comprising:
-
setting a hazard pointer to an address of a portion of a data structure to be removed;
removing the portion of the data structure; and
ensuring that memory associated with the removed portion of the data structure is freed only when the hazard pointer no longer points to the removed portion of the data structure.
-
Specification