Patent ID: 8209692
Filing Date: 2012-06-26
Classification: G06F,Y10S

Abstract:
1. A method of deallocating a data structure accessible by a plurality of threads executing in a computer, comprising, in response to a request to deallocate the data structure: setting a shared pointer to the data structure to a predetermined value that indicates to a thread thereafter accessing the pointer that the data structure is not available; after setting the shared pointer to the predetermined value, waiting until each of the plurality of threads is no longer using the shared pointer by monitoring the program code executed by each thread to determine whether each thread is executing program code that is capable of using the shared pointer to access the data structure; deallocating the data structure after setting the shared pointer to the predetermined value and waiting until each of the plurality of threads is no longer using the shared pointer; incrementing a sequence number associated with a first thread among the plurality of threads from a first value selected from a first set of values to a second value selected from a second set of values whenever the first thread enters the program code; and incrementing the sequence number from the second value to a third value selected from the first set of values whenever the first thread exits the program code; wherein waiting until each of the plurality of threads is no longer using the shared pointer includes capturing a value of the sequence number prior to monitoring each thread, and wherein determining whether each thread is executing program code that is capable of using the shared pointer to access the data structure includes determining using the sequence number whether the first thread is not currently executing the program code or that the first thread has exited the program code by determining whether the sequence number associated with the first thread has a value selected from the second set of values, and determining whether the sequence number has a value that differs from the captured value.