8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 #include "precompiled.hpp"
26 #include "oops/oop.inline.hpp"
27 #include "runtime/os.hpp"
28 #include "utilities/debug.hpp"
29 #include "utilities/stack.inline.hpp"
30 #include "utilities/taskqueue.hpp"
31 #ifdef TARGET_OS_FAMILY_linux
32 # include "thread_linux.inline.hpp"
33 #endif
34 #ifdef TARGET_OS_FAMILY_solaris
35 # include "thread_solaris.inline.hpp"
36 #endif
37 #ifdef TARGET_OS_FAMILY_windows
38 # include "thread_windows.inline.hpp"
39 #endif
40 #ifdef TARGET_OS_FAMILY_bsd
41 # include "thread_bsd.inline.hpp"
42 #endif
43
44 #ifdef TRACESPINNING
45 uint ParallelTaskTerminator::_total_yields = 0;
46 uint ParallelTaskTerminator::_total_spins = 0;
47 uint ParallelTaskTerminator::_total_peeks = 0;
48 #endif
49
50 #if TASKQUEUE_STATS
51 const char * const TaskQueueStats::_names[last_stat_id] = {
52 "qpush", "qpop", "qpop-s", "qattempt", "qsteal", "opush", "omax"
53 };
54
55 TaskQueueStats & TaskQueueStats::operator +=(const TaskQueueStats & addend)
56 {
57 for (unsigned int i = 0; i < last_stat_id; ++i) {
58 _stats[i] += addend._stats[i];
59 }
60 return *this;
61 }
62
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 #include "precompiled.hpp"
26 #include "oops/oop.inline.hpp"
27 #include "runtime/os.hpp"
28 #include "runtime/thread.inline.hpp"
29 #include "utilities/debug.hpp"
30 #include "utilities/stack.inline.hpp"
31 #include "utilities/taskqueue.hpp"
32
33 #ifdef TRACESPINNING
34 uint ParallelTaskTerminator::_total_yields = 0;
35 uint ParallelTaskTerminator::_total_spins = 0;
36 uint ParallelTaskTerminator::_total_peeks = 0;
37 #endif
38
39 #if TASKQUEUE_STATS
40 const char * const TaskQueueStats::_names[last_stat_id] = {
41 "qpush", "qpop", "qpop-s", "qattempt", "qsteal", "opush", "omax"
42 };
43
44 TaskQueueStats & TaskQueueStats::operator +=(const TaskQueueStats & addend)
45 {
46 for (unsigned int i = 0; i < last_stat_id; ++i) {
47 _stats[i] += addend._stats[i];
48 }
49 return *this;
50 }
51
|