Patent ID: 7650371

Claim:
A method for using finalizable objects in transactions in a software transactional memory system operating on a computing device, comprising the steps of: providing a software transactional memory system in a managed code environment comprising a garbage collector that reclaims memory used by a transaction, the software transactional memory system controls access to shared memory in a concurrent computing system; providing a to-be-finalized set for the transaction in the software transactional memory system that supports allocation of finalizable objects inside the transaction to indicate to the garbage collector that a particular one or more of the objects are eligible for finalization; allocating a finalizable object within the transaction; placing an object into the to-be-finalized set for the transaction upon allocation of the finalizable object; determining whether the transaction is to be committed; if the transaction is to be committed, determining whether the transaction is a closed, flattened or parallel nesting transaction; and if the transaction is a closed, flattened or parallel nesting transaction, copying contents of the to-be-finalized set for the transaction to a to-be-finalized set of a parent transaction of the transaction if the transaction is not a closed, flattened or parallel nesting transaction, traversing contents of the to-be-finalized set for the transaction setting an indicator to indicate the finalizable object is eligible for finalization by the garbage collector; if the transaction is not to be committed, determining whether the transaction is to be rolled back; and, if the transaction is to be rolled back, discarding contents of the to-be-finalized set for the transaction.