mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Added comment description for params set
This commit is contained in:
parent
99e321f64a
commit
bc286a0002
1 changed files with 8 additions and 0 deletions
|
|
@ -40,6 +40,14 @@ public class ThreadExecutor {
|
|||
private static final ExecutorService gameExecutor = Executors.newFixedThreadPool(ConfigSettings.getInstance().getMaxGameThreads());
|
||||
private static final ScheduledExecutorService timeoutExecutor = Executors.newScheduledThreadPool(5);
|
||||
|
||||
/**
|
||||
* noxx: what the settings below do is setting the ability to keep OS threads for new games for 60 seconds
|
||||
* If there is no new game created within this time period, the thread may be discarded.
|
||||
* But anyway if new game is created later, new OS/java thread will be created for it
|
||||
* taking MaxGameThreads limit into account.
|
||||
*
|
||||
* This all is done for performance reasons as creating new OS threads is resource consuming process.
|
||||
*/
|
||||
static {
|
||||
((ThreadPoolExecutor)callExecutor).setKeepAliveTime(60, TimeUnit.SECONDS);
|
||||
((ThreadPoolExecutor)callExecutor).allowCoreThreadTimeOut(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue