src/share/vm/utilities/taskqueue.cpp

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   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 "incls/_precompiled.incl"
  26 # include "incls/_taskqueue.cpp.incl"













  27 
  28 #ifdef TRACESPINNING
  29 uint ParallelTaskTerminator::_total_yields = 0;
  30 uint ParallelTaskTerminator::_total_spins = 0;
  31 uint ParallelTaskTerminator::_total_peeks = 0;
  32 #endif
  33 
  34 #if TASKQUEUE_STATS
  35 const char * const TaskQueueStats::_names[last_stat_id] = {
  36   "qpush", "qpop", "qpop-s", "qattempt", "qsteal", "opush", "omax"
  37 };
  38 
  39 TaskQueueStats & TaskQueueStats::operator +=(const TaskQueueStats & addend)
  40 {
  41   for (unsigned int i = 0; i < last_stat_id; ++i) {
  42     _stats[i] += addend._stats[i];
  43   }
  44   return *this;
  45 }
  46 




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   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 
  41 #ifdef TRACESPINNING
  42 uint ParallelTaskTerminator::_total_yields = 0;
  43 uint ParallelTaskTerminator::_total_spins = 0;
  44 uint ParallelTaskTerminator::_total_peeks = 0;
  45 #endif
  46 
  47 #if TASKQUEUE_STATS
  48 const char * const TaskQueueStats::_names[last_stat_id] = {
  49   "qpush", "qpop", "qpop-s", "qattempt", "qsteal", "opush", "omax"
  50 };
  51 
  52 TaskQueueStats & TaskQueueStats::operator +=(const TaskQueueStats & addend)
  53 {
  54   for (unsigned int i = 0; i < last_stat_id; ++i) {
  55     _stats[i] += addend._stats[i];
  56   }
  57   return *this;
  58 }
  59