ThreadPool( Group group, ThreadGroup parentThreadGroup ) { threadFactory = new GroupedDaemonThreadFactory( group, parentThreadGroup ); executor = group.buildExecutorService( threadFactory ); registry = new ConcurrentHashMap<>(); }
private ExecutorService createNewWorkStealingExecutor( Group group, int parallelism, boolean asyncMode ) { ForkJoinPool.ForkJoinWorkerThreadFactory factory = new GroupedDaemonThreadFactory( group, topLevelGroup ); return new ForkJoinPool( parallelism, factory, null, asyncMode ); }
protected CentralJobScheduler() { workStealingExecutors = new ConcurrentHashMap<>( 1 ); topLevelGroup = new TopLevelGroup(); pools = new ThreadPoolManager( topLevelGroup ); ThreadFactory threadFactory = new GroupedDaemonThreadFactory( Group.TASK_SCHEDULER, topLevelGroup ); scheduler = new TimeBasedTaskScheduler( Clocks.nanoClock(), pools ); // The scheduler thread runs at slightly elevated priority for timeliness, and is started in init(). schedulerThread = threadFactory.newThread( scheduler ); int priority = Thread.NORM_PRIORITY + 1; schedulerThread.setPriority( priority ); }
private ExecutorService createNewWorkStealingExecutor( Group group, int parallelism, boolean asyncMode ) { ForkJoinPool.ForkJoinWorkerThreadFactory factory = new GroupedDaemonThreadFactory( group, topLevelGroup ); return new ForkJoinPool( parallelism, factory, null, asyncMode ); }
ThreadPool( Group group, ThreadGroup parentThreadGroup ) { threadFactory = new GroupedDaemonThreadFactory( group, parentThreadGroup ); executor = group.buildExecutorService( threadFactory ); registry = new ConcurrentHashMap<>(); }
protected CentralJobScheduler() { workStealingExecutors = new ConcurrentHashMap<>( 1 ); topLevelGroup = new TopLevelGroup(); pools = new ThreadPoolManager( topLevelGroup ); ThreadFactory threadFactory = new GroupedDaemonThreadFactory( Group.TASK_SCHEDULER, topLevelGroup ); scheduler = new TimeBasedTaskScheduler( Clocks.nanoClock(), pools ); // The scheduler thread runs at slightly elevated priority for timeliness, and is started in init(). schedulerThread = threadFactory.newThread( scheduler ); int priority = Thread.NORM_PRIORITY + 1; schedulerThread.setPriority( priority ); }