src/share/vm/utilities/yieldingWorkgroup.hpp

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 
  26 // Forward declarations
  27 class YieldingFlexibleWorkGang;
  28 
  29 // Status of tasks
  30 enum Status {
  31     INACTIVE,
  32     ACTIVE,
  33     YIELDING,
  34     YIELDED,
  35     ABORTING,
  36     ABORTED,
  37     COMPLETING,
  38     COMPLETED
  39 };
  40 
  41 // Class YieldingFlexibleGangWorker:
  42 //   Several instances of this class run in parallel as workers for a gang.
  43 class YieldingFlexibleGangWorker: public GangWorker {
  44 public:


 194 private:
 195   int _active_workers;
 196   int _yielded_workers;
 197   void wait_for_gang();
 198 
 199 public:
 200   // Accessors for fields
 201   int active_workers() const {
 202     return _active_workers;
 203   }
 204 
 205   // Accessors for fields
 206   int yielded_workers() const {
 207     return _yielded_workers;
 208   }
 209 
 210 private:
 211   friend class YieldingFlexibleGangWorker;
 212   void reset(); // NYI
 213 };




   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 #ifndef SHARE_VM_UTILITIES_YIELDINGWORKGROUP_HPP
  26 #define SHARE_VM_UTILITIES_YIELDINGWORKGROUP_HPP
  27 
  28 #ifndef SERIALGC
  29 #include "utilities/workgroup.hpp"
  30 #endif
  31 
  32 
  33 // Forward declarations
  34 class YieldingFlexibleWorkGang;
  35 
  36 // Status of tasks
  37 enum Status {
  38     INACTIVE,
  39     ACTIVE,
  40     YIELDING,
  41     YIELDED,
  42     ABORTING,
  43     ABORTED,
  44     COMPLETING,
  45     COMPLETED
  46 };
  47 
  48 // Class YieldingFlexibleGangWorker:
  49 //   Several instances of this class run in parallel as workers for a gang.
  50 class YieldingFlexibleGangWorker: public GangWorker {
  51 public:


 201 private:
 202   int _active_workers;
 203   int _yielded_workers;
 204   void wait_for_gang();
 205 
 206 public:
 207   // Accessors for fields
 208   int active_workers() const {
 209     return _active_workers;
 210   }
 211 
 212   // Accessors for fields
 213   int yielded_workers() const {
 214     return _yielded_workers;
 215   }
 216 
 217 private:
 218   friend class YieldingFlexibleGangWorker;
 219   void reset(); // NYI
 220 };
 221 
 222 #endif // SHARE_VM_UTILITIES_YIELDINGWORKGROUP_HPP