Method and apparatus for isolating selected heap objects using a faulting address trap
First Claim
Patent Images
1. A method for processing heap objects with an atomic operation using a faulting address trap, the method comprising:
- selecting, by a first thread of a plurality of concurrently executing threads, a subset of heap objects;
transforming, by the first thread, each reference to each heap object of the subset of heap objects in such a manner that the faulting address trap will be raised if an attempt is made by any other thread of the plurality of concurrently executing threads to access the heap object with the transformed reference;
processing, by the first thread, each heap object of the subset of heap objects with the atomic operation, wherein an indication that the atomic operation has been performed on the heap object is stored; and
if the faulting address trap is raised during the processing of the subset of heap objects by the first thread because a second thread of the plurality of concurrently executing threads has attempted to access a heap object of the subset of heap objects, suspending the second thread until the atomic operation is performed on the heap object the second thread attempted to access.
2 Assignments
0 Petitions
Accused Products
Abstract
All references to an object subset to which an atomic operation is to be applied are deliberately transformed so that an attempt by an application thread to dereference such a transformed reference will raise a faulting address trap. When the faulting address trap is raised, the faulting thread will enter a trap handler, which suspends the faulting thread. The atomic operation can then be applied and the faulting thread restarted.
-
Citations
40 Claims
-
1. A method for processing heap objects with an atomic operation using a faulting address trap, the method comprising:
-
selecting, by a first thread of a plurality of concurrently executing threads, a subset of heap objects; transforming, by the first thread, each reference to each heap object of the subset of heap objects in such a manner that the faulting address trap will be raised if an attempt is made by any other thread of the plurality of concurrently executing threads to access the heap object with the transformed reference; processing, by the first thread, each heap object of the subset of heap objects with the atomic operation, wherein an indication that the atomic operation has been performed on the heap object is stored; and if the faulting address trap is raised during the processing of the subset of heap objects by the first thread because a second thread of the plurality of concurrently executing threads has attempted to access a heap object of the subset of heap objects, suspending the second thread until the atomic operation is performed on the heap object the second thread attempted to access. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
-
-
20. Apparatus for processing selected heap objects with an atomic operation using a faulting address trap, the apparatus comprising:
-
a memory storing a plurality of heap objects and a faulting address trap handler for the faulting address trap; and a processor that executes a plurality, of concurrently executing threads, wherein the plurality of concurrently executing threads can reference the plurality of heap objects, wherein a first thread of the plurality of concurrently executing threads; selects a subset of the plurality of heap objects; transforms each reference to each heap object of the subset of heap objects in such a manner that the faulting address trap will be raised if an attempt is made by any other thread of the plurality of concurrently executing threads to access the heap object with the transformed reference; and processes each heap object of the subset of heap objects with the atomic operation, wherein an indication that the atomic operation has been performed on the heap object is stored; and wherein the faulting address trap handler; suspends the second thread if the faulting address trap is raised during the processing of the subset of heap objects by the first thread because a second thread of the plurality of concurrently executing threads has attempted to access a heap object of the subset of heap objects, wherein the second thread is suspended until the atomic operation has been is performed on the heap object the second thread attempted to access. - View Dependent Claims (21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38)
-
-
39. Apparatus for processing selected heap objects with an atomic operation using a faulting address trap, the apparatus comprising:
-
means for selecting, by a first thread of a plurality of concurrently executing threads, a subset of heap objects; means for transforming, by the first thread, each reference to each heap object of the subset of heap objects in such a manner that the faulting address trap will be raised if an attempt is made by any other thread of the plurality of concurrently executing threads to access the heap object with the transformed reference; means for processing, by the first thread, each heap object of the subset of heap objects with the atomic operation, wherein an indication that the atomic operation has been performed on the heap object is stored; and means operable if the faulting address trap is raised during the processing of the subset of heap objects by the first thread because a second thread of the plurality of concurrently executing threads has attempted to access a heap object of the subset of heap objects, for suspending the second thread until the atomic operation is performed on the heap object the second thread attempted to access.
-
-
40. A computer readable medium comprising computer program code stored therein for processing selected heap objects with an atomic operation using a faulting address trap, the computer program code comprising:
-
program code for selecting, by a first thread of a plurality of concurrently executing threads, a subset of heap objects; program code for transforming, by the first thread, each reference to each heap object of the subset of heap objects in such a manner that the faulting address trap will be raised if an attempt is made by any other thread of the plurality of concurrently executing threads to access the heap object with the transformed reference; program code for processing, by the first thread, each heap object of the subset of heap objects with the atomic operation, wherein an indication that the atomic operation has been performed on the heap object is stored; and program code operable if the faulting address trap is raised during the processing of the subset of heap objects by the first thread because a second thread of the plurality of concurrently executing threads has attempted to access a heap object of the subset of heap objects, for suspending the second thread until the atomic operation is performed on the heap object the second thread attempted to access.
-
Specification