Multiple mode object locking method and system
First Claim
1. A method of operating an object-based multi-threaded computing system having a cyclic garbage collection strategy and including an object locking system having (i) a first mode in which access by a single thread without contention to an object is controlled by a monitor internal to said object, and (ii) a second mode in which access by multiple threads with contention to said object is controlled by a monitor external to said object, and wherein for any given object a transition from the first mode to the second mode is termed inflation, and a transition from the second mode to the first mode is termed deflation, said method including the steps of:
- entering a period of contention for an object in said first mode;
inflating said object to said second mode;
updating an inflation rate value for said object, said value corresponding to a length of an interval between successive periods of contention, and said value being maintained over successive garbage collection cycles;
ending a period of contention for said object;
comparing the inflation rate value against a first predetermined value;
deflating or not deflating said object, based on the result of the comparison; and
resetting the inflation rate value at the next garbage collection cycle of the system.
1 Assignment
0 Petitions
Accused Products
Abstract
An object-based multi-threaded computing system has a cyclic garbage collection strategy and includes an object locking system having (i) a first mode in which access by a single thread without contention to an object is controlled by a monitor internal to said object, and (ii) a second mode in which access by multiple threads with contention to said object is controlled by a monitor external to said object. For any given object a transition from the first mode to the second mode is termed inflation, and a transition from the second mode to the first mode is termed deflation. Responsive to the start of a period of contention for an object in said first mode, the object is inflated to the second mode, and an inflation rate counter is incremented. After the period of contention has concluded the value of the inflation rate counter is compared against a predetermined value in order to determine whether or not to deflate the object. The inflation rate counter is reset at every garbage collection cycle.
79 Citations
20 Claims
-
1. A method of operating an object-based multi-threaded computing system having a cyclic garbage collection strategy and including an object locking system having (i) a first mode in which access by a single thread without contention to an object is controlled by a monitor internal to said object, and (ii) a second mode in which access by multiple threads with contention to said object is controlled by a monitor external to said object, and wherein for any given object a transition from the first mode to the second mode is termed inflation, and a transition from the second mode to the first mode is termed deflation, said method including the steps of:
-
entering a period of contention for an object in said first mode;
inflating said object to said second mode;
updating an inflation rate value for said object, said value corresponding to a length of an interval between successive periods of contention, and said value being maintained over successive garbage collection cycles;
ending a period of contention for said object;
comparing the inflation rate value against a first predetermined value;
deflating or not deflating said object, based on the result of the comparison; and
resetting the inflation rate value at the next garbage collection cycle of the system. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. An object-based multi-threaded computing system having a cyclic garbage collection strategy and including an object locking system having (i) a first mode in which access by a single thread without contention to an object is controlled by a monitor internal to said object, and (ii) a second mode in which access by multiple threads with contention to said object is controlled by a monitor external to said object, and wherein for any given object a transition from the first mode to the second mode is termed inflation, and a transition from the second mode to the first mode is termed deflation, said computer system including:
-
means for entering a period of contention for an object in said first mode;
means for inflating said object to said second mode;
means for updating an inflation rate value for said object, said value corresponding to a length of an interval between successive periods of contention, and said value being maintained over successive garbage collection cycles;
means for ending a period of contention for said object;
means for comparing the inflation rate value against a first predetermined value;
means for deflating or not deflating said object, based on the result of the comparison; and
means for resetting the inflation rate value at the next garbage collection cycle of the system. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A computing system having:
-
a plurality of objects, each object including an internal monitor to control access to said object in a first mode of object locking;
a plurality of monitors, each monitor controlling access to a corresponding one of said plurality of objects in a second mode of object locking, and including an inflation counter which is incremented by a transition from said first mode of object locking to said second mode of object locking, said inflation counter keeping track of a value which corresponds to a length of an interval between successive periods of contention, said value being maintained over successive garbage collection cycles; and
a garbage collector including means for resetting said inflation counter.
-
-
20. A computer program product for use in an object-based multi-threaded computing system having a cyclic garbage collection strategy and including an object locking system having (i) a first mode in which access by a single thread without contention to an object is controlled by a monitor internal to said object, and (ii) a second mode in which access by multiple threads with contention to said object is controlled by a monitor external to said object, and wherein for any given object a transition from the first mode to the second mode is termed inflation, and a transition from the second mode to the first mode is termed deflation, said computer program product including computer readable instructions recorded in a storage medium for implementing the steps of:
-
entering a period of contention for an object in said first mode;
inflating said object to said second mode;
updating an inflation rate value for said object, said value corresponding to a length of an interval between successive periods of contention, and said value being maintained over successive garbage collection cycles;
ending a period of contention for said object;
comparing the inflation rate value against a first predetermined value;
deflating or not deflating said object, based on the result of the comparison; and
resetting the inflation rate value at the next garbage collection cycle of the system.
-
Specification