rendered paste bodyIndex: C:/workspace/L2_GameServer/java/net/sf/l2j/Config.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/Config.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/Config.java (working copy)
@@ -72,6 +72,7 @@
/** Thread pools size */
public static int THREAD_P_HIGH;
+ public static int THREAD_P_MEDHIGH;
public static int THREAD_P_MED;
public static int THREAD_P_LOW;
@@ -389,8 +390,9 @@
public static int EXECUTOR_PRI_LOW;
public static int EXECUTOR_PRI_MED;
+ public static int EXECUTOR_PRI_MEDHIGH;
public static int EXECUTOR_PRI_HIGH;
-
+ public static int EXECUTOR_PRI_AI;
public static enum IdFactoryType
{
@@ -584,7 +586,8 @@
AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(serverSettings.getProperty("AutoDeleteInvalidQuestData", "False"));
THREAD_P_HIGH = Integer.parseInt(serverSettings.getProperty("ThreadPoolSizeHigh", "4"));
- THREAD_P_MED = Integer.parseInt(serverSettings.getProperty("ThreadPoolSizeMed", "10"));
+ THREAD_P_MEDHIGH = Integer.parseInt(serverSettings.getProperty("ThreadPoolSizeMedHigh","4"));
+ THREAD_P_MED = Integer.parseInt(serverSettings.getProperty("ThreadPoolSizeMed", "10"));
THREAD_P_LOW = Integer.parseInt(serverSettings.getProperty("ThreadPoolSizeLow", "4"));
MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
@@ -618,7 +621,9 @@
EXECUTOR_PRI_LOW = Integer.parseInt(serverSettings.getProperty("ExecutorPriLow", "-1"));
EXECUTOR_PRI_MED = Integer.parseInt(serverSettings.getProperty("ExecutorPriMed", "0"));
+ EXECUTOR_PRI_MEDHIGH = Integer.parseInt(serverSettings.getProperty("ExecutorPriMedHigh", "1"));
EXECUTOR_PRI_HIGH = Integer.parseInt(serverSettings.getProperty("ExecutorPriHigh", "2"));
+ EXECUTOR_PRI_AI = Integer.parseInt(serverSettings.getProperty("ExecutorPriAi", "1"));
}
catch (Exception e)
{
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/SelectorThread.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/SelectorThread.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/SelectorThread.java (working copy)
@@ -140,7 +140,7 @@
if (Config.ASSERT) assert instance == null;
if (Config.COUNT_PACKETS)
{
- packetMonitor = ClientScheduler.getInstance().scheduleLowAtFixedRate(new MonitorPackets(), 10000, 10000);
+ packetMonitor = ClientScheduler.getInstance().scheduleMedAtFixedRate(new MonitorPackets(), 10000, 10000);
}
instance = this;
this._hostname = hostname;
@@ -723,7 +723,7 @@
packetHistory.clear();
byteHistory.clear();
- packetMonitor = ClientScheduler.getInstance().scheduleLowAtFixedRate(
+ packetMonitor = ClientScheduler.getInstance().scheduleMedAtFixedRate(
new Runnable()
{
public void run()
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/clientpackets/RequestRestartPoint.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/clientpackets/RequestRestartPoint.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/clientpackets/RequestRestartPoint.java (working copy)
@@ -112,21 +112,21 @@
&& castle.getSiege().checkIsAttacker(activeChar.getClan()))
{
// Schedule respawn delay for attacker
- ClientScheduler.getInstance().scheduleLow(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
+ ClientScheduler.getInstance().scheduleMed(new DeathTask(activeChar), castle.getSiege().getAttackerRespawnDelay());
sm.addString("You will be re-spawned in " + castle.getSiege().getAttackerRespawnDelay()/1000 + " seconds");
activeChar.sendPacket(sm);
}
else
{
// Schedule respawn delay for defender with penalty for CT lose
- ClientScheduler.getInstance().scheduleLow(new DeathTask(activeChar), castle.getSiege().getDefenderRespawnDelay());
+ ClientScheduler.getInstance().scheduleMed(new DeathTask(activeChar), castle.getSiege().getDefenderRespawnDelay());
sm.addString("You will be re-spawned in " + castle.getSiege().getDefenderRespawnDelay()/1000 + " seconds");
activeChar.sendPacket(sm);
}
return;
}
- ClientScheduler.getInstance().scheduleLow(new DeathTask(activeChar), 1);
+ ClientScheduler.getInstance().scheduleMed(new DeathTask(activeChar), 1);
}
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/L2Potion.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/L2Potion.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/L2Potion.java (working copy)
@@ -179,7 +179,7 @@
private void startPotionMpRegeneration(L2Character activeChar)
{
- _potionmpRegTask = ClientScheduler.getInstance().scheduleMedAtFixedRate(
+ _potionmpRegTask = ClientScheduler.getInstance().scheduleMedHighAtFixedRate(
new PotionMpHealing(activeChar), 1000, _milliseconds);
if (Config.DEBUG) _log.fine("Potion MP regen Started");
}
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/actor/character/CharStatus.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/actor/character/CharStatus.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/actor/character/CharStatus.java (working copy)
@@ -197,7 +197,7 @@
int period = Formulas.getInstance().getRegeneratePeriod(getActiveChar());
// Create the HP/MP/CP Regeneration task
- _RegTask = ClientScheduler.getInstance().scheduleMedAtFixedRate(new RegenTask(), period, period);
+ _RegTask = ClientScheduler.getInstance().scheduleMedHighAtFixedRate(new RegenTask(), period, period);
}
}
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/L2Character.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/L2Character.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/L2Character.java (working copy)
@@ -391,7 +392,7 @@
{
// If L2PcInstance doesn't have enough MP, stop the attack
- ClientScheduler.getInstance().scheduleMed(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), 1000);
+ ClientScheduler.getInstance().scheduleAi(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), 1000);
sendPacket(new SystemMessage(SystemMessage.NOT_ENOUGH_MP));
@@ -411,7 +412,7 @@
else
{
// Cancel the action because the bow can't be re-use at this moment
- ClientScheduler.getInstance().scheduleMed(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), 1000);
+ ClientScheduler.getInstance().scheduleAi(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), 1000);
ActionFailed af = new ActionFailed();
sendPacket(af);
@@ -497,7 +498,7 @@
int reuse = weaponItem==null ? 0 : weaponItem.getAttackReuseDelay();
// Notify AI with EVT_READY_TO_ACT
- ClientScheduler.getInstance().scheduleMed(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), sAtk+reuse);
+ ClientScheduler.getInstance().scheduleAi(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), sAtk+reuse);
}
/**
@@ -573,7 +574,7 @@
}
// Create a new hit task with Medium priority
- ClientScheduler.getInstance().scheduleMed(new HitTask(target, damage1, crit1, miss1, attack._soulshot, shld1), sAtk);
+ ClientScheduler.getInstance().scheduleMedHigh(new HitTask(target, damage1, crit1, miss1, attack._soulshot, shld1), sAtk);
// Calculate and set the disable delay of the bow in function of the Attack Speed
_disableBowAttackEndTime = (sAtk+reuse)/GameTimeController.MILLIS_IN_TICK + GameTimeController.getGameTicks();
@@ -643,10 +644,10 @@
}
// Create a new hit task with Medium priority for hit 1
- ClientScheduler.getInstance().scheduleMed(new HitTask(target, damage1, crit1, miss1, attack._soulshot, shld1), 650);
+ ClientScheduler.getInstance().scheduleMedHigh(new HitTask(target, damage1, crit1, miss1, attack._soulshot, shld1), 650);
// Create a new hit task with Medium priority for hit 2 with a higher delay
- ClientScheduler.getInstance().scheduleMed(new HitTask(target, damage2, crit2, miss2, attack._soulshot, shld2), 1250);
+ ClientScheduler.getInstance().scheduleMedHigh(new HitTask(target, damage2, crit2, miss2, attack._soulshot, shld2), 1250);
// Add those hits to the Server-Client packet Attack
attack.addHit(target, damage1, miss1, crit1, shld1);
@@ -790,7 +791,7 @@
}
// Create a new hit task with Medium priority
- ClientScheduler.getInstance().scheduleMed(new HitTask(target, damage1, crit1, miss1, attack._soulshot, shld1), 980);
+ ClientScheduler.getInstance().scheduleMedHigh(new HitTask(target, damage1, crit1, miss1, attack._soulshot, shld1), 980);
// Add this hit to the Server-Client packet Attack
attack.addHit(target, damage1, miss1, crit1, shld1);
@@ -968,7 +969,7 @@
if (reuseDelay > 10)
{
disableSkill(skill.getId());
- ClientScheduler.getInstance().scheduleMed(new EnableSkill(skill.getId()), reuseDelay);
+ ClientScheduler.getInstance().scheduleMedHigh(new EnableSkill(skill.getId()), reuseDelay);
}
// launch the magic in skillTime milliseconds
@@ -983,7 +984,7 @@
// Disable all skills during the casting time and create a task EnableAllSkills with Medium priority to enable all skills at the end of the cating time
disableAllSkills();
- ClientScheduler.getInstance().scheduleMed(new EnableAllSkills(skill), skillTime);
+ ClientScheduler.getInstance().scheduleMedHigh(new EnableAllSkills(skill), skillTime);
if (_skillCast != null)
{
@@ -992,7 +993,7 @@
}
// Create a task MagicUseTask with Medium priority to launch the MagicSkill at the end of the casting time
- _skillCast = ClientScheduler.getInstance().scheduleMed(new MagicUseTask(targets, skill), skillTime);
+ _skillCast = ClientScheduler.getInstance().scheduleMedHigh(new MagicUseTask(targets, skill), skillTime);
}
else
{
@@ -3253,7 +3254,7 @@
// Create a task to notify the AI that L2Character arrives at a check point of the movement
if (tm > 3000)
- ClientScheduler.getInstance().scheduleMed( new NotifyAITask(CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
+ ClientScheduler.getInstance().scheduleAi( new NotifyAITask(CtrlEvent.EVT_ARRIVED_REVALIDATE), 2000);
// the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive
// to destination by GameTimeController
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/L2AttackableAI.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/L2AttackableAI.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/L2AttackableAI.java (working copy)
@@ -244,7 +244,7 @@
// If not idle - create an AI task (schedule onEvtThink repeatedly)
if (aiTask == null)
{
- aiTask = ClientScheduler.getInstance().scheduleLowAtFixedRate(this, 1000, 1000);
+ aiTask = ClientScheduler.getInstance().scheduleAiAtFixedRate(this, 1000, 1000);
}
}
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/L2SiegeGuardAI.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/L2SiegeGuardAI.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/L2SiegeGuardAI.java (working copy)
@@ -197,7 +197,7 @@
// If not idle - create an AI task (schedule onEvtThink repeatedly)
if (aiTask == null)
{
- aiTask = ClientScheduler.getInstance().scheduleLowAtFixedRate(this, 1000, 1000);
+ aiTask = ClientScheduler.getInstance().scheduleAiAtFixedRate(this, 1000, 1000);
}
}
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/AbstractAI.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/AbstractAI.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ai/AbstractAI.java (working copy)
@@ -714,7 +714,7 @@
// Create and Launch an AI Follow Task to execute every 1s
_follow_target = target;
- _follow_task = ClientScheduler.getInstance().scheduleMedAtFixedRate(new FollowTask(), 5, FOLLOW_INTERVAL);
+ _follow_task = ClientScheduler.getInstance().scheduleAiAtFixedRate(new FollowTask(), 5, FOLLOW_INTERVAL);
}
/**
@@ -732,7 +732,7 @@
}
_follow_target = target;
- _follow_task = ClientScheduler.getInstance().scheduleMedAtFixedRate(new FollowTask(range), 5, ATTACK_FOLLOW_INTERVAL);
+ _follow_task = ClientScheduler.getInstance().scheduleAiAtFixedRate(new FollowTask(range), 5, ATTACK_FOLLOW_INTERVAL);
}
/**
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/RecipeController.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/RecipeController.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/RecipeController.java (working copy)
@@ -405,7 +405,7 @@
isValid = true;
timeReady = GameTimeController.TICKS_PER_SECOND + GameTimeController.getGameTicks();
- ClientScheduler.getInstance().scheduleLow(this, 1100);
+ ClientScheduler.getInstance().scheduleLow(this, 200);
}
public void run()
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ClientScheduler.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ClientScheduler.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/ClientScheduler.java (working copy)
@@ -53,8 +53,10 @@
private static final ClientScheduler _instance = new ClientScheduler();
private final ScheduledThreadPoolExecutor _executorHighPriority;
+ private final ScheduledThreadPoolExecutor _executorMedHighPriority;
private final ScheduledThreadPoolExecutor _executorMedPriority;
private final ScheduledThreadPoolExecutor _executorLowPriority;
+ private final ScheduledThreadPoolExecutor _executorAi;
/**
@@ -74,8 +76,10 @@
if (Config.ASSERT) assert _instance == null;
_executorHighPriority = new ScheduledThreadPoolExecutor(Config.THREAD_P_HIGH, new ThrFactory(Config.EXECUTOR_PRI_HIGH, "PoolHIGH"));
- _executorMedPriority = new ScheduledThreadPoolExecutor(Config.THREAD_P_MED, new ThrFactory(Config.EXECUTOR_PRI_MED, "PoolMED"));
+ _executorMedHighPriority = new ScheduledThreadPoolExecutor(Config.THREAD_P_HIGH, new ThrFactory(Config.EXECUTOR_PRI_HIGH-1, "PoolHIGH"));
+ _executorMedPriority = new ScheduledThreadPoolExecutor(Config.THREAD_P_MED, new ThrFactory(Config.EXECUTOR_PRI_MED, "PoolMED"));
_executorLowPriority = new ScheduledThreadPoolExecutor(Config.THREAD_P_LOW, new ThrFactory(Config.EXECUTOR_PRI_LOW, "PoolLOW"));
+ _executorAi = new ScheduledThreadPoolExecutor(Config.THREAD_P_MED, new ThrFactory((Config.EXECUTOR_PRI_HIGH-1), "PoolHIGH"));
}
/**
@@ -83,17 +87,23 @@
*/
public void closeAll()
{
- try { _executorHighPriority.shutdown(); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
+ try { _executorHighPriority.shutdown(); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
+ try { _executorMedHighPriority.shutdown(); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
try { _executorMedPriority.shutdown(); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
try { _executorLowPriority.shutdown(); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
+ try { _executorAi.shutdown(); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
- try { _executorHighPriority.awaitTermination(1000, TimeUnit.MILLISECONDS); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
+ try { _executorHighPriority.awaitTermination(1000, TimeUnit.MILLISECONDS); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
+ try { _executorMedHighPriority.awaitTermination(1000, TimeUnit.MILLISECONDS); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
try { _executorMedPriority.awaitTermination(1000, TimeUnit.MILLISECONDS); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
try { _executorLowPriority.awaitTermination(1000, TimeUnit.MILLISECONDS); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
+ try { _executorAi.awaitTermination(1000, TimeUnit.MILLISECONDS); } catch (Throwable t) { _log.log(Level.WARNING, "", t); }
_executorHighPriority.shutdownNow();
- _executorHighPriority.shutdownNow();
- _executorHighPriority.shutdownNow();
+ _executorMedHighPriority.shutdownNow();
+ _executorMedPriority.shutdownNow();
+ _executorLowPriority.shutdownNow();
+ _executorAi.shutdownNow();
}
@@ -169,7 +180,33 @@
} catch (RejectedExecutionException e) { return null; /* shutdown, ignore */ }
}
-
+ /**
+ * Create a MedHigh priority task that is executed after an initial time (in ms) and each delay ms.<BR><BR>
+ *
+ * @param r The task to launch
+ * @param initial The initial delay (in ms) after what the task is executed for the first time
+ * @param delay The delay (in ms) between 2 consecutive executions of the task
+ *
+ */
+ public ScheduledFuture scheduleMedHighAtFixedRate(Runnable r, long initial, long delay)
+ {
+ try
+ {
+ if (delay < 0) delay = 0;
+ return _executorMedHighPriority.scheduleAtFixedRate(r, initial, delay, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) { return null; /* shutdown, ignore */ }
+ }
+
+ public ScheduledFuture scheduleAiAtFixedRate(Runnable r, long initial, long delay)
+ {
+ try
+ {
+ if (delay < 0) delay = 0;
+ return _executorAi.scheduleAtFixedRate(r, initial, delay, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) { return null; /* shutdown, ignore */ }
+ }
+
+
/**
* Create a Medium priority task that is executed after an initial time (in ms) and each delay ms.<BR><BR>
*
@@ -254,7 +292,22 @@
} catch (RejectedExecutionException e) { return null; /* shutdown, ignore */ }
}
-
+ /**
+ * Create a MediumHigh priority task that is executed after an initial time (in ms).<BR><BR>
+ *
+ * @param r The task to launch
+ * @param initial The initial delay (in ms) after what the task is executed for the first time
+ * @param delay The delay (in ms) between 2 consecutive executions of the task
+ *
+ */
+ public ScheduledFuture scheduleMedHigh(Runnable r, long delay)
+ {
+ try
+ {
+ if (delay < 0) delay = 0;
+ return _executorMedHighPriority.schedule(r, delay, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) { return null; /* shutdown, ignore */ }
+ }
/**
* Create a Medium priority task that is executed after an initial time (in ms).<BR><BR>
*
@@ -263,6 +316,7 @@
* @param delay The delay (in ms) between 2 consecutive executions of the task
*
*/
+
public ScheduledFuture scheduleMed(Runnable r, long delay)
{
try
@@ -289,6 +343,14 @@
} catch (RejectedExecutionException e) { return null; /* shutdown, ignore */ }
}
+ public ScheduledFuture scheduleAi(Runnable r, long delay)
+ {
+ try
+ {
+ if (delay < 0) delay = 0;
+ return _executorAi.schedule(r, delay, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) { return null; /* shutdown, ignore */ }
+ }
class ThrFactory implements ThreadFactory
{
@@ -316,30 +378,41 @@
{
return new String[] {
"HIGH ("+Config.EXECUTOR_PRI_HIGH+")",
- "ActiveThreads: "+_executorHighPriority.getActiveCount(),
- "CompletedTasks: "+_executorHighPriority.getCompletedTaskCount(),
- "getCorePoolSize: "+_executorHighPriority.getCorePoolSize(),
- "MaximumPoolSize: "+_executorHighPriority.getMaximumPoolSize(),
- "LargestPoolSize: "+_executorHighPriority.getLargestPoolSize(),
- "PoolSize: "+_executorHighPriority.getPoolSize(),
- "ScheduledTasks: "+(_executorHighPriority.getTaskCount() - _executorHighPriority.getCompletedTaskCount()),
- "MEDIUM ("+Config.EXECUTOR_PRI_MED+")",
- "ActiveThreads: "+_executorMedPriority.getActiveCount(),
- "CompletedTasks: "+_executorMedPriority.getCompletedTaskCount(),
- "getCorePoolSize: "+_executorMedPriority.getCorePoolSize(),
- "MaximumPoolSize: "+_executorMedPriority.getMaximumPoolSize(),
- "LargestPoolSize: "+_executorMedPriority.getLargestPoolSize(),
- "PoolSize: "+_executorMedPriority.getPoolSize(),
- "ScheduledTasks: "+(_executorMedPriority.getTaskCount() - _executorMedPriority.getCompletedTaskCount()),
+ "ActiveThreads: "+_executorHighPriority.getActiveCount(),
+ "CompletedTasks: "+_executorHighPriority.getCompletedTaskCount(),
+ "ScheduledTasks: "+(_executorHighPriority.getTaskCount() - _executorHighPriority.getCompletedTaskCount()),
+ "TaskCount(total): "+_executorHighPriority.getTaskCount(),
+ "PoolSize: "+_executorHighPriority.getPoolSize(),
+ "",
+ "MEDHIGH ("+(Config.EXECUTOR_PRI_HIGH-1)+")",
+ "ActiveThreads: "+_executorMedHighPriority.getActiveCount(),
+ "TaskCount(total): "+_executorMedHighPriority.getTaskCount(),
+ "CompletedTasks: "+_executorMedHighPriority.getCompletedTaskCount(),
+ "ScheduledTasks: "+(_executorMedHighPriority.getTaskCount() - _executorMedHighPriority.getCompletedTaskCount()),
+ "PoolSize: "+_executorMedHighPriority.getPoolSize(),
+ "",
+ "MEDIUM ("+(Config.EXECUTOR_PRI_MED)+")",
+ "ActiveThreads: "+_executorMedPriority.getActiveCount(),
+ "CompletedTasks: "+_executorMedPriority.getCompletedTaskCount(),
+ "ScheduledTasks: "+(_executorMedPriority.getTaskCount() - _executorMedPriority.getCompletedTaskCount()),
+ "TaskCount(total): "+_executorMedPriority.getTaskCount(),
+ "PoolSize: "+_executorMedPriority.getPoolSize(),
+ "",
"LOW ("+Config.EXECUTOR_PRI_LOW+")",
- "ActiveThreads: "+_executorLowPriority.getActiveCount(),
- "CompletedTasks: "+_executorLowPriority.getCompletedTaskCount(),
- "getCorePoolSize: "+_executorLowPriority.getCorePoolSize(),
- "MaximumPoolSize: "+_executorLowPriority.getMaximumPoolSize(),
- "LargestPoolSize: "+_executorLowPriority.getLargestPoolSize(),
- "PoolSize: "+_executorLowPriority.getPoolSize(),
- "ScheduledTasks: "+(_executorLowPriority.getTaskCount() - _executorLowPriority.getCompletedTaskCount())
+ "ActiveThreads: "+_executorLowPriority.getActiveCount(),
+ "CompletedTasks: "+_executorLowPriority.getCompletedTaskCount(),
+ "ScheduledTasks: "+(_executorLowPriority.getTaskCount() - _executorLowPriority.getCompletedTaskCount()),
+ "TaskCount(total): "+_executorLowPriority.getTaskCount(),
+ "PoolSize: "+_executorLowPriority.getPoolSize(),
+ "",
+ "AI ("+(Config.EXECUTOR_PRI_HIGH-1)+")",
+ "ActiveThreads: "+_executorAi.getActiveCount(),
+ "CompletedTasks: "+_executorAi.getCompletedTaskCount(),
+ "ScheduledTasks: "+(_executorAi.getTaskCount() - _executorAi.getCompletedTaskCount()),
+ "TaskCount(total): "+_executorAi.getTaskCount(),
+ "PoolSize: "+_executorAi.getPoolSize(),
+ ""
};
+
}
@@ -348,4 +421,9 @@
return getInstance().scheduleLow(event, delay);
}
+ public static ScheduledFuture scheduleAiAction(Runnable event, long delay)
+ {
+ return getInstance().scheduleAi(event, delay);
+ }
+
}
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/taskmanager/tasks/TaskCleanUp.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/taskmanager/tasks/TaskCleanUp.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/taskmanager/tasks/TaskCleanUp.java (working copy)
@@ -23,13 +23,13 @@
public void onTimeElapsed(ExecutedTask task)
{
- System.runFinalization();
- System.gc();
+ //System.runFinalization();
+ //System.gc(); // use -Xincgc parameter to java.exe runtime executable, avoid calling full gc() at all costs
}
public void initializate()
{
super.initializate();
- TaskManager.addUniqueTask(NAME, TaskTypes.TYPE_FIXED_SHEDULED, "0", "1800000", "");
+ //TaskManager.addUniqueTask(NAME, TaskTypes.TYPE_FIXED_SHEDULED, "0", "1800000", "");
}
}
Index: C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/GameTimeController.java
===================================================================
--- C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/GameTimeController.java (revision 2124)
+++ C:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/GameTimeController.java (working copy)
@@ -72,9 +72,9 @@
_timer = new TimerThread();
_timer.start();
- ClientScheduler.getInstance().scheduleLowAtFixedRate(
+ ClientScheduler.getInstance().scheduleMedAtFixedRate(
new TimerWatcher(), 0, 1000);
- ClientScheduler.getInstance().scheduleLowAtFixedRate(
+ ClientScheduler.getInstance().scheduleMedAtFixedRate(
new BroadcastSunState(), 0, 60*60*1000
);
}
@@ -151,7 +151,7 @@
// Create a task to update the _knownObject and _knowPlayers of each L2Character that finished its movement and of their already known L2Object
// then notify AI with EVT_ARRIVED
if (ended != null)
- ClientScheduler.getInstance().scheduleLow(new MovingObjectArrived(ended), 10);
+ ClientScheduler.getInstance().scheduleMed(new MovingObjectArrived(ended), 10);
}