10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHPACER_HPP
26 #define SHARE_GC_SHENANDOAH_SHENANDOAHPACER_HPP
27
28 #include "gc/shenandoah/shenandoahNumberSeq.hpp"
29 #include "gc/shenandoah/shenandoahPadding.hpp"
30 #include "memory/allocation.hpp"
31
32 class ShenandoahHeap;
33
34 #define PACING_PROGRESS_UNINIT (-1)
35 #define PACING_PROGRESS_ZERO ( 0)
36
37 /**
38 * ShenandoahPacer provides allocation pacing mechanism.
39 *
40 * Currently it implements simple tax-and-spend pacing policy: GC threads provide
41 * credit, allocating thread spend the credit, or stall when credit is not available.
42 */
43 class ShenandoahPacer : public CHeapObj<mtGC> {
44 private:
45 ShenandoahHeap* _heap;
46 double _last_time;
47 TruncatedSeq* _progress_history;
48 Monitor* _wait_monitor;
49 ShenandoahSharedFlag _need_notify_waiters;
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHPACER_HPP
26 #define SHARE_GC_SHENANDOAH_SHENANDOAHPACER_HPP
27
28 #include "gc/shenandoah/shenandoahNumberSeq.hpp"
29 #include "gc/shenandoah/shenandoahPadding.hpp"
30 #include "gc/shenandoah/shenandoahSharedVariables.hpp"
31 #include "memory/allocation.hpp"
32
33 class ShenandoahHeap;
34
35 #define PACING_PROGRESS_UNINIT (-1)
36 #define PACING_PROGRESS_ZERO ( 0)
37
38 /**
39 * ShenandoahPacer provides allocation pacing mechanism.
40 *
41 * Currently it implements simple tax-and-spend pacing policy: GC threads provide
42 * credit, allocating thread spend the credit, or stall when credit is not available.
43 */
44 class ShenandoahPacer : public CHeapObj<mtGC> {
45 private:
46 ShenandoahHeap* _heap;
47 double _last_time;
48 TruncatedSeq* _progress_history;
49 Monitor* _wait_monitor;
50 ShenandoahSharedFlag _need_notify_waiters;
|