Finalizable object usage in software transactions
First Claim
1. 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 transactionif 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.
2 Assignments
0 Petitions
Accused Products
Abstract
Various technologies and techniques are disclosed for providing a software transactional memory system that supports allocation and use of finalizable objects inside transactions. By supporting such finalizable object usage inside a software transactional memory system, correct behavior is maintained when a garbage collector must determine when a particular one or more of the objects are eligible for finalization. A to-be-finalized set is provided for a transaction. An object is placed into the to-be-finalized set for the transaction whenever a finalizable object is allocated within the transaction. A finalize indicator is set for each object in the to-be-finalized set at an appropriate time to indicate that the objects are eligible for finalization. For example, if the transaction is ready to commit and the transaction is an open transaction, then the to-be-finalized set is traversed and a finalize indicator is set for each object to indicate they are eligible for finalization.
-
Citations
12 Claims
-
1. 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. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A computer-readable medium having computer-executable instructions for causing a computer to perform steps comprising:
-
provide 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 supports allocation of finalizable objects inside a transaction; provide a to-be-finalized set for a transaction; allocate a finalizable object within the transaction; place an object into the to-be-finalized set for the transaction upon allocation of the finalizable object within the transaction; 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.
-
-
8. 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 supports allocation of finalizable objects inside a transaction; creating a to-be-finalized set for a transaction; whenever a finalizable object is allocated while a transaction is alive, placing the finalizable object into the to-be-finalized set for the transaction; and if the transaction is ready to commit, determining whether the transaction is a closed, flattened or parallel nesting transaction; 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; and if the transaction is an open nested or non-nested transaction, then traversing the to-be-finalized set and setting a finalize indicator for each object to indicate to the garbage collector that each object is eligible to finalize 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 ready 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. - View Dependent Claims (9, 10, 11, 12)
-
Specification