Eliminating memory corruption when performing tree functions on multiple threads
First Claim
1. A method for eliminating memory corruption comprising the steps of:
- receiving a command to perform a tree operation on a tree associated with a thread; and
locking one or more resources associated with said requested tree operation during an execution of said requested tree operation using a first and a second semaphore, wherein said one or more resources are associated with said first semaphore and said second semaphore, wherein the step of locking further comprises the steps of;
indicating whether a resource associated with said first semaphore is locked or is available to be accessed by other threads based on a value of said first semaphore; and
indicating whether a resource associated with said second semaphore during a portion of said execution of said requested tree operation is locked or is available to be accessed by other threads based on a value of said second semaphore;
wherein said resource associated with said second semaphore is locked during a portion of said execution of said requested tree operation, wherein said resource associated with said second semaphore is made available during a remaining portion of said execution of said requested tree operation.
5 Assignments
0 Petitions
Accused Products
Abstract
A method, system and computer program product for eliminating memory corruption when performing multi-threaded tree operations. A network processor may receive a command to perform a tree operation on a tree on one or more of multiple threads. Upon performing the requested tree operation, the network processor may lock one or more resources during a portion of the execution of the requested tree operation using one or more semaphores. A semaphore may refer to a flag used to indicate whether to “lock” or make available the resource associated with the semaphore. Locking may refer to preventing the resource from being available to other threads. Hence, by locking one or more resources during a portion of the tree operation, memory corruption may be eliminated in a multiple thread system while preventing these resources from being used by other threads for a minimal amount of time.
38 Citations
27 Claims
-
1. A method for eliminating memory corruption comprising the steps of:
-
receiving a command to perform a tree operation on a tree associated with a thread; and locking one or more resources associated with said requested tree operation during an execution of said requested tree operation using a first and a second semaphore, wherein said one or more resources are associated with said first semaphore and said second semaphore, wherein the step of locking further comprises the steps of; indicating whether a resource associated with said first semaphore is locked or is available to be accessed by other threads based on a value of said first semaphore; and indicating whether a resource associated with said second semaphore during a portion of said execution of said requested tree operation is locked or is available to be accessed by other threads based on a value of said second semaphore; wherein said resource associated with said second semaphore is locked during a portion of said execution of said requested tree operation, wherein said resource associated with said second semaphore is made available during a remaining portion of said execution of said requested tree operation. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A computer program product embodied in a machine readable medium for eliminating memory corruption comprising the programming steps of:
-
receiving a command to perform a tree operation on a tree associated with a thread; and locking one or more resources associated with said requested tree operation during an execution of said requested tree operation using a first and a second semaphore, wherein said one or more resources are associated with said first semaphore and said second semaphore, wherein the programming step of locking further comprises the programming steps of; indicating whether a resource associated with said first semaphore is locked or is available to be accessed by other threads based on a value of said first semaphore; and indicating whether a resource associated with said second semaphore during a portion of said execution of said requested tree operation is locked or is available to be accessed by other threads based on a value of said second semaphore; wherein said resource associated with said second semaphore is locked during a portion of said execution of said requested tree operation, wherein said resource associated with said second semaphore is made available during a remaining portion of said execution of said requested tree operation. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A network processor, comprising:
-
a memory unit operable for storing a computer program for eliminating memory corruption; and a processor coupled to said memory unit, wherein said processor, responsive to said computer program, comprises; circuitry operable for receiving a command to perform a tree operation on a tree associated with a thread; and circuitry operable for locking one or more resources associated with said requested tree operation during an execution of said requested tree operation using a first and a second semaphore, wherein said one or more resources are associated with said first semaphore and said second semaphore, wherein said circuitry operable for locking further comprises; circuitry operable for indicating whether a resource associated with said first semaphore is locked or is available to be accessed by other threads based oh a value of said first semaphore; and circuitry operable for indicating whether a resource associated with said second semaphore during a portion of said execution of said requested tree operation is locked or is available to be accessed by other threads based on a value of said second semaphore; wherein said resource associated with said second semaphore is locked during a portion of said execution of said requested tree operation, wherein said resource associated with said second semaphore is made available during a remaining portion of said execution of said requested tree operation. - View Dependent Claims (20, 21, 22, 23, 24, 25, 26, 27)
-
Specification