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 "gc/shared/gcId.hpp"
27 #include "gc/shared/workgroup.hpp"
28 #include "gc/shared/workerManager.hpp"
29 #include "memory/allocation.hpp"
30 #include "memory/allocation.inline.hpp"
31 #include "runtime/atomic.hpp"
32 #include "runtime/os.hpp"
33 #include "runtime/semaphore.hpp"
34 #include "runtime/thread.inline.hpp"
35
36 // Definitions of WorkGang methods.
37
38 // The current implementation will exit if the allocation
39 // of any worker fails.
40 void AbstractWorkGang::initialize_workers() {
41 log_develop_trace(gc, workgang)("Constructing work gang %s with %u threads", name(), total_workers());
42 _workers = NEW_C_HEAP_ARRAY(AbstractGangWorker*, total_workers(), mtInternal);
43 add_workers(true);
44 }
45
46
47 AbstractGangWorker* AbstractWorkGang::install_worker(uint worker_id) {
48 AbstractGangWorker* new_worker = allocate_worker(worker_id);
49 set_thread(worker_id, new_worker);
50 return new_worker;
|
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 "gc/shared/gcId.hpp"
27 #include "gc/shared/workgroup.hpp"
28 #include "gc/shared/workerManager.hpp"
29 #include "memory/allocation.hpp"
30 #include "memory/allocation.inline.hpp"
31 #include "memory/iterator.hpp"
32 #include "runtime/atomic.hpp"
33 #include "runtime/os.hpp"
34 #include "runtime/semaphore.hpp"
35 #include "runtime/thread.inline.hpp"
36
37 // Definitions of WorkGang methods.
38
39 // The current implementation will exit if the allocation
40 // of any worker fails.
41 void AbstractWorkGang::initialize_workers() {
42 log_develop_trace(gc, workgang)("Constructing work gang %s with %u threads", name(), total_workers());
43 _workers = NEW_C_HEAP_ARRAY(AbstractGangWorker*, total_workers(), mtInternal);
44 add_workers(true);
45 }
46
47
48 AbstractGangWorker* AbstractWorkGang::install_worker(uint worker_id) {
49 AbstractGangWorker* new_worker = allocate_worker(worker_id);
50 set_thread(worker_id, new_worker);
51 return new_worker;
|