< prev index next >

src/hotspot/share/gc/shared/taskTerminator.hpp

Print this page

        

*** 20,31 **** * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ ! #ifndef SHARE_GC_SHARED_OWSTTASKTERMINATOR_HPP ! #define SHARE_GC_SHARED_OWSTTASKTERMINATOR_HPP #include "memory/allocation.hpp" #include "runtime/mutex.hpp" #include "runtime/thread.hpp" --- 20,31 ---- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ ! #ifndef SHARE_GC_SHARED_TASKTERMINATOR_HPP ! #define SHARE_GC_SHARED_TASKTERMINATOR_HPP #include "memory/allocation.hpp" #include "runtime/mutex.hpp" #include "runtime/thread.hpp"
*** 34,58 **** class TaskQueueSetSuper; class TerminatorTerminator; /* ! * Provides a task termination protocol. OWST stands for Optimized Work Stealing Threads * ! * This is an enhanced implementation of Google's work stealing task termination ! * protocol, which is described in the paper: * "Wessam Hassanein. 2016. Understanding and improving JVM GC work * stealing at the data center scale. In Proceedings of the 2016 ACM * SIGPLAN International Symposium on Memory Management (ISMM 2016). ACM, * New York, NY, USA, 46-54. DOI: https://doi.org/10.1145/2926697.2926706" * * Instead of a dedicated spin-master, our implementation will let spin-master relinquish * the role before it goes to sleep/wait, allowing newly arrived threads to compete for the role. * The intention of above enhancement is to reduce spin-master's latency on detecting new tasks * for stealing and termination condition. */ ! class OWSTTaskTerminator : public CHeapObj<mtGC> { uint _n_threads; TaskQueueSetSuper* _queue_set; DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, 0); volatile uint _offered_termination; --- 34,60 ---- class TaskQueueSetSuper; class TerminatorTerminator; /* ! * Provides a task termination protocol. * ! * This is an enhanced implementation of Google's OWST work stealing task termination ! * protocol (OWST stands for Optimized Work Stealing Threads). ! * ! * It is described in the paper: * "Wessam Hassanein. 2016. Understanding and improving JVM GC work * stealing at the data center scale. In Proceedings of the 2016 ACM * SIGPLAN International Symposium on Memory Management (ISMM 2016). ACM, * New York, NY, USA, 46-54. DOI: https://doi.org/10.1145/2926697.2926706" * * Instead of a dedicated spin-master, our implementation will let spin-master relinquish * the role before it goes to sleep/wait, allowing newly arrived threads to compete for the role. * The intention of above enhancement is to reduce spin-master's latency on detecting new tasks * for stealing and termination condition. */ ! class TaskTerminator : public CHeapObj<mtGC> { uint _n_threads; TaskQueueSetSuper* _queue_set; DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, 0); volatile uint _offered_termination;
*** 79,93 **** // Perform spin-master task. // Return true if termination condition is detected, otherwise return false bool do_spin_master_work(TerminatorTerminator* terminator); ! NONCOPYABLE(OWSTTaskTerminator); public: ! OWSTTaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set); ! ~OWSTTaskTerminator(); // The current thread has no work, and is ready to terminate if everyone // else is. If returns "true", all threads are terminated. If returns // "false", available work has been observed in one of the task queues, // so the global task is not complete. --- 81,95 ---- // Perform spin-master task. // Return true if termination condition is detected, otherwise return false bool do_spin_master_work(TerminatorTerminator* terminator); ! NONCOPYABLE(TaskTerminator); public: ! TaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set); ! ~TaskTerminator(); // The current thread has no work, and is ready to terminate if everyone // else is. If returns "true", all threads are terminated. If returns // "false", available work has been observed in one of the task queues, // so the global task is not complete.
*** 115,121 **** static uint total_peeks() { return _total_peeks; } static void print_termination_counts(); #endif }; ! ! #endif // SHARE_GC_SHARED_OWSTTASKTERMINATOR_HPP --- 117,122 ---- static uint total_peeks() { return _total_peeks; } static void print_termination_counts(); #endif }; ! #endif // SHARE_GC_SHARED_TASKTERMINATOR_HPP
< prev index next >