public synchronized void initTaskSchedulerIfNot(){
  if (scheduler == null) {
    scheduler=Executors.newSingleThreadScheduledExecutor(DaemonThreadFactory.getInstance());
    CapacityAwareTaskScheduler runner=new CapacityAwareTaskScheduler();
    scheduler.scheduleAtFixedRate(runner,ParallecGlobalConfig.schedulerInitDelay,ParallecGlobalConfig.schedulerCheckInterval,TimeUnit.MILLISECONDS);
    logger.info("initialized daemon task scheduler to evaluate waitQ tasks.");
  }
}

public synchronized void initTaskSchedulerIfNot ( ) { if ( scheduler == null ) { scheduler = Executors . newSingleThreadScheduledExecutor ( DaemonThreadFactory . getInstance ( ) ) ; CapacityAwareTaskScheduler runner = new CapacityAwareTaskScheduler ( ) ; scheduler . scheduleAtFixedRate ( runner , ParallecGlobalConfig . schedulerInitDelay , ParallecGlobalConfig . schedulerCheckInterval , TimeUnit . MILLISECONDS ) ; logger . info ( "initialized daemon task scheduler to evaluate waitQ tasks." ) ; } }
as it is daemon thread todo when release external resources should shutdown the scheduler .
