content: /**
   * This file is part of Aion-Lightning <aion-lightning.org>.
   *
   *  Aion-Lightning is free software: you can redistribute it and/or modify
   *  it under the terms of the GNU General Public License as published by
   *  the Free Software Foundation, either version 3 of the License, or
   *  (at your option) any later version.
   *
   *  Aion-Lightning is distributed in the hope that it will be useful,
   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   *  GNU General Public License for more details. *
   *  You should have received a copy of the GNU General Public License
   *  along with Aion-Lightning.
   *  If not, see <http://www.gnu.org/licenses/>.
   */
  package com.aionemu.gameserver.configs.main;
  
  import com.aionemu.commons.configuration.Property;
  
  /**
   * @author lord_rex
   * @modified Rolandas, changed formula which had no sense.
   */
  public class ThreadConfig {
  
  	/**
  	 * Thread basepoolsize
  	 */
  	@Property(key = "gameserver.thread.basepoolsize", defaultValue = "1")
  	public static int BASE_THREAD_POOL_SIZE;
  	/**
  	 * Thread threadpercore
  	 */
  	@Property(key = "gameserver.thread.threadpercore", defaultValue = "4")
  	public static int EXTRA_THREAD_PER_CORE;
  	/**
  	 * Thread runtime
  	 */
  	@Property(key = "gameserver.thread.runtime", defaultValue = "5000")
  	public static long MAXIMUM_RUNTIME_IN_MILLISEC_WITHOUT_WARNING;
  	/**
  	 * For instant pool set priority to 7, in Linux you must be root and use extra switches
  	 */
  	@Property(key = "gameserver.thread.usepriority", defaultValue = "false")
  	public static boolean USE_PRIORITIES;
  	public static int THREAD_POOL_SIZE;
  
  	public static void load() {
  		final int extraThreadPerCore = EXTRA_THREAD_PER_CORE;
  
  		THREAD_POOL_SIZE = (BASE_THREAD_POOL_SIZE + extraThreadPerCore) * Runtime.getRuntime().availableProcessors();
  	}
  }
  