annotate src/share/vm/utilities/yieldingWorkgroup.hpp @ 11122:81b6cb70717c jdk8-b99

Merge
author katleman
date Tue, 16 Jul 2013 15:15:43 -0700
parents db9981fd3124
children de88570fabfc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1837
c99c53f07c14 6692906: CMS: parallel concurrent marking may be prone to hanging or stalling mutators for periods of time
ysr
parents: 1833
diff changeset
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 342
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 342
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 342
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1837
diff changeset
25 #ifndef SHARE_VM_UTILITIES_YIELDINGWORKGROUP_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1837
diff changeset
26 #define SHARE_VM_UTILITIES_YIELDINGWORKGROUP_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1837
diff changeset
27
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 7434
diff changeset
28 #include "utilities/macros.hpp"
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 7434
diff changeset
29 #if INCLUDE_ALL_GCS
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1837
diff changeset
30 #include "utilities/workgroup.hpp"
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 7434
diff changeset
31 #endif // INCLUDE_ALL_GCS
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1837
diff changeset
32
0
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // Forward declarations
a61af66fc99e Initial load
duke
parents:
diff changeset
35 class YieldingFlexibleWorkGang;
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // Status of tasks
a61af66fc99e Initial load
duke
parents:
diff changeset
38 enum Status {
a61af66fc99e Initial load
duke
parents:
diff changeset
39 INACTIVE,
a61af66fc99e Initial load
duke
parents:
diff changeset
40 ACTIVE,
a61af66fc99e Initial load
duke
parents:
diff changeset
41 YIELDING,
a61af66fc99e Initial load
duke
parents:
diff changeset
42 YIELDED,
a61af66fc99e Initial load
duke
parents:
diff changeset
43 ABORTING,
a61af66fc99e Initial load
duke
parents:
diff changeset
44 ABORTED,
a61af66fc99e Initial load
duke
parents:
diff changeset
45 COMPLETING,
a61af66fc99e Initial load
duke
parents:
diff changeset
46 COMPLETED
a61af66fc99e Initial load
duke
parents:
diff changeset
47 };
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // Class YieldingFlexibleGangWorker:
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // Several instances of this class run in parallel as workers for a gang.
a61af66fc99e Initial load
duke
parents:
diff changeset
51 class YieldingFlexibleGangWorker: public GangWorker {
a61af66fc99e Initial load
duke
parents:
diff changeset
52 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
53 // Ctor
a61af66fc99e Initial load
duke
parents:
diff changeset
54 YieldingFlexibleGangWorker(AbstractWorkGang* gang, int id) :
a61af66fc99e Initial load
duke
parents:
diff changeset
55 GangWorker(gang, id) { }
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
58 YieldingFlexibleWorkGang* yf_gang() const
a61af66fc99e Initial load
duke
parents:
diff changeset
59 { return (YieldingFlexibleWorkGang*)gang(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 protected: // Override from parent class
a61af66fc99e Initial load
duke
parents:
diff changeset
62 virtual void loop();
a61af66fc99e Initial load
duke
parents:
diff changeset
63 };
a61af66fc99e Initial load
duke
parents:
diff changeset
64
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
65 class FlexibleGangTask: public AbstractGangTask {
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
66 int _actual_size; // size of gang obtained
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
67 protected:
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
68 int _requested_size; // size of gang requested
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
69 public:
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
70 FlexibleGangTask(const char* name): AbstractGangTask(name),
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
71 _requested_size(0) {}
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
72
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
73 // The abstract work method.
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
74 // The argument tells you which member of the gang you are.
4728
441e946dc1af 7121618: Change type of number of GC workers to unsigned int.
jmasa
parents: 4095
diff changeset
75 virtual void work(uint worker_id) = 0;
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
76
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
77 int requested_size() const { return _requested_size; }
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
78 int actual_size() const { return _actual_size; }
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
79
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
80 void set_requested_size(int sz) { _requested_size = sz; }
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
81 void set_actual_size(int sz) { _actual_size = sz; }
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
82 };
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
83
0
a61af66fc99e Initial load
duke
parents:
diff changeset
84 // An abstract task to be worked on by a flexible work gang,
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // and where the workers will periodically yield, usually
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // in response to some condition that is signalled by means
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // that are specific to the task at hand.
a61af66fc99e Initial load
duke
parents:
diff changeset
88 // You subclass this to supply your own work() method.
a61af66fc99e Initial load
duke
parents:
diff changeset
89 // A second feature of this kind of work gang is that
a61af66fc99e Initial load
duke
parents:
diff changeset
90 // it allows for the signalling of certain exceptional
a61af66fc99e Initial load
duke
parents:
diff changeset
91 // conditions that may be encountered during the performance
a61af66fc99e Initial load
duke
parents:
diff changeset
92 // of the task and that may require the task at hand to be
a61af66fc99e Initial load
duke
parents:
diff changeset
93 // `aborted' forthwith. Finally, these gangs are `flexible'
a61af66fc99e Initial load
duke
parents:
diff changeset
94 // in that they can operate at partial capacity with some
a61af66fc99e Initial load
duke
parents:
diff changeset
95 // gang workers waiting on the bench; in other words, the
a61af66fc99e Initial load
duke
parents:
diff changeset
96 // size of the active worker pool can flex (up to an apriori
a61af66fc99e Initial load
duke
parents:
diff changeset
97 // maximum) in response to task requests at certain points.
a61af66fc99e Initial load
duke
parents:
diff changeset
98 // The last part (the flexible part) has not yet been fully
a61af66fc99e Initial load
duke
parents:
diff changeset
99 // fleshed out and is a work in progress.
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
100 class YieldingFlexibleGangTask: public FlexibleGangTask {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
101 Status _status;
a61af66fc99e Initial load
duke
parents:
diff changeset
102 YieldingFlexibleWorkGang* _gang;
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
105 // Constructor and desctructor: only construct subclasses.
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
106 YieldingFlexibleGangTask(const char* name): FlexibleGangTask(name),
0
a61af66fc99e Initial load
duke
parents:
diff changeset
107 _status(INACTIVE),
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
108 _gang(NULL) { }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
109
7434
32164d89fe9c 8004845: Catch incorrect usage of new and delete during compile time for value objects and stack objects
brutisso
parents: 4728
diff changeset
110 ~YieldingFlexibleGangTask() { }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 friend class YieldingFlexibleWorkGang;
a61af66fc99e Initial load
duke
parents:
diff changeset
113 friend class YieldingFlexibleGangWorker;
a61af66fc99e Initial load
duke
parents:
diff changeset
114 NOT_PRODUCT(virtual bool is_YieldingFlexibleGang_task() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
115 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 })
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 void set_status(Status s) {
a61af66fc99e Initial load
duke
parents:
diff changeset
119 _status = s;
a61af66fc99e Initial load
duke
parents:
diff changeset
120 }
a61af66fc99e Initial load
duke
parents:
diff changeset
121 YieldingFlexibleWorkGang* gang() {
a61af66fc99e Initial load
duke
parents:
diff changeset
122 return _gang;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 }
a61af66fc99e Initial load
duke
parents:
diff changeset
124 void set_gang(YieldingFlexibleWorkGang* gang) {
a61af66fc99e Initial load
duke
parents:
diff changeset
125 assert(_gang == NULL || gang == NULL, "Clobber without intermediate reset?");
a61af66fc99e Initial load
duke
parents:
diff changeset
126 _gang = gang;
a61af66fc99e Initial load
duke
parents:
diff changeset
127 }
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
130 // The abstract work method.
a61af66fc99e Initial load
duke
parents:
diff changeset
131 // The argument tells you which member of the gang you are.
4728
441e946dc1af 7121618: Change type of number of GC workers to unsigned int.
jmasa
parents: 4095
diff changeset
132 virtual void work(uint worker_id) = 0;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
133
a61af66fc99e Initial load
duke
parents:
diff changeset
134 // Subclasses should call the parent's yield() method
a61af66fc99e Initial load
duke
parents:
diff changeset
135 // after having done any work specific to the subclass.
a61af66fc99e Initial load
duke
parents:
diff changeset
136 virtual void yield();
a61af66fc99e Initial load
duke
parents:
diff changeset
137
a61af66fc99e Initial load
duke
parents:
diff changeset
138 // An abstract method supplied by
a61af66fc99e Initial load
duke
parents:
diff changeset
139 // a concrete sub-class which is used by the coordinator
a61af66fc99e Initial load
duke
parents:
diff changeset
140 // to do any "central yielding" work.
a61af66fc99e Initial load
duke
parents:
diff changeset
141 virtual void coordinator_yield() = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 // Subclasses should call the parent's abort() method
a61af66fc99e Initial load
duke
parents:
diff changeset
144 // after having done any work specific to the sunbclass.
a61af66fc99e Initial load
duke
parents:
diff changeset
145 virtual void abort();
a61af66fc99e Initial load
duke
parents:
diff changeset
146
a61af66fc99e Initial load
duke
parents:
diff changeset
147 Status status() const { return _status; }
1837
c99c53f07c14 6692906: CMS: parallel concurrent marking may be prone to hanging or stalling mutators for periods of time
ysr
parents: 1833
diff changeset
148 bool yielding() const { return _status == YIELDING; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
149 bool yielded() const { return _status == YIELDED; }
a61af66fc99e Initial load
duke
parents:
diff changeset
150 bool completed() const { return _status == COMPLETED; }
a61af66fc99e Initial load
duke
parents:
diff changeset
151 bool aborted() const { return _status == ABORTED; }
a61af66fc99e Initial load
duke
parents:
diff changeset
152 bool active() const { return _status == ACTIVE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
153 };
a61af66fc99e Initial load
duke
parents:
diff changeset
154 // Class YieldingWorkGang: A subclass of WorkGang.
a61af66fc99e Initial load
duke
parents:
diff changeset
155 // In particular, a YieldingWorkGang is made up of
a61af66fc99e Initial load
duke
parents:
diff changeset
156 // YieldingGangWorkers, and provides infrastructure
a61af66fc99e Initial load
duke
parents:
diff changeset
157 // supporting yielding to the "GangOverseer",
a61af66fc99e Initial load
duke
parents:
diff changeset
158 // being the thread that orchestrates the WorkGang via run_task().
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
159 class YieldingFlexibleWorkGang: public FlexibleWorkGang {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
160 // Here's the public interface to this class.
a61af66fc99e Initial load
duke
parents:
diff changeset
161 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
162 // Constructor and destructor.
4728
441e946dc1af 7121618: Change type of number of GC workers to unsigned int.
jmasa
parents: 4095
diff changeset
163 YieldingFlexibleWorkGang(const char* name, uint workers,
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
164 bool are_GC_task_threads);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
165
a61af66fc99e Initial load
duke
parents:
diff changeset
166 YieldingFlexibleGangTask* yielding_task() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
167 assert(task() == NULL || task()->is_YieldingFlexibleGang_task(),
a61af66fc99e Initial load
duke
parents:
diff changeset
168 "Incorrect cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
169 return (YieldingFlexibleGangTask*)task();
a61af66fc99e Initial load
duke
parents:
diff changeset
170 }
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
171 // Allocate a worker and return a pointer to it.
4728
441e946dc1af 7121618: Change type of number of GC workers to unsigned int.
jmasa
parents: 4095
diff changeset
172 GangWorker* allocate_worker(uint which);
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
173
0
a61af66fc99e Initial load
duke
parents:
diff changeset
174 // Run a task; returns when the task is done, or the workers yield,
a61af66fc99e Initial load
duke
parents:
diff changeset
175 // or the task is aborted, or the work gang is terminated via stop().
a61af66fc99e Initial load
duke
parents:
diff changeset
176 // A task that has been yielded can be continued via this same interface
a61af66fc99e Initial load
duke
parents:
diff changeset
177 // by using the same task repeatedly as the argument to the call.
a61af66fc99e Initial load
duke
parents:
diff changeset
178 // It is expected that the YieldingFlexibleGangTask carries the appropriate
a61af66fc99e Initial load
duke
parents:
diff changeset
179 // continuation information used by workers to continue the task
a61af66fc99e Initial load
duke
parents:
diff changeset
180 // from its last yield point. Thus, a completed task will return
a61af66fc99e Initial load
duke
parents:
diff changeset
181 // immediately with no actual work having been done by the workers.
a61af66fc99e Initial load
duke
parents:
diff changeset
182 void run_task(AbstractGangTask* task) {
a61af66fc99e Initial load
duke
parents:
diff changeset
183 guarantee(false, "Use start_task instead");
a61af66fc99e Initial load
duke
parents:
diff changeset
184 }
a61af66fc99e Initial load
duke
parents:
diff changeset
185 void start_task(YieldingFlexibleGangTask* new_task);
a61af66fc99e Initial load
duke
parents:
diff changeset
186 void continue_task(YieldingFlexibleGangTask* gang_task);
a61af66fc99e Initial load
duke
parents:
diff changeset
187
a61af66fc99e Initial load
duke
parents:
diff changeset
188 // Abort a currently running task, if any; returns when all the workers
a61af66fc99e Initial load
duke
parents:
diff changeset
189 // have stopped working on the current task and have returned to their
a61af66fc99e Initial load
duke
parents:
diff changeset
190 // waiting stations.
a61af66fc99e Initial load
duke
parents:
diff changeset
191 void abort_task();
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 // Yield: workers wait at their current working stations
a61af66fc99e Initial load
duke
parents:
diff changeset
194 // until signalled to proceed by the overseer.
a61af66fc99e Initial load
duke
parents:
diff changeset
195 void yield();
a61af66fc99e Initial load
duke
parents:
diff changeset
196
a61af66fc99e Initial load
duke
parents:
diff changeset
197 // Abort: workers are expected to return to their waiting
a61af66fc99e Initial load
duke
parents:
diff changeset
198 // stations, whence they are ready for the next task dispatched
a61af66fc99e Initial load
duke
parents:
diff changeset
199 // by the overseer.
a61af66fc99e Initial load
duke
parents:
diff changeset
200 void abort();
a61af66fc99e Initial load
duke
parents:
diff changeset
201
a61af66fc99e Initial load
duke
parents:
diff changeset
202 private:
4728
441e946dc1af 7121618: Change type of number of GC workers to unsigned int.
jmasa
parents: 4095
diff changeset
203 uint _yielded_workers;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
204 void wait_for_gang();
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
207 // Accessors for fields
4728
441e946dc1af 7121618: Change type of number of GC workers to unsigned int.
jmasa
parents: 4095
diff changeset
208 uint yielded_workers() const {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
209 return _yielded_workers;
a61af66fc99e Initial load
duke
parents:
diff changeset
210 }
a61af66fc99e Initial load
duke
parents:
diff changeset
211
a61af66fc99e Initial load
duke
parents:
diff changeset
212 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
213 friend class YieldingFlexibleGangWorker;
a61af66fc99e Initial load
duke
parents:
diff changeset
214 void reset(); // NYI
a61af66fc99e Initial load
duke
parents:
diff changeset
215 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1837
diff changeset
216
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1837
diff changeset
217 #endif // SHARE_VM_UTILITIES_YIELDINGWORKGROUP_HPP