Use two threads for the server thread pool

This might help with long DNS timeouts.
This commit is contained in:
heinrich5991 2018-10-07 12:47:32 +02:00
parent fc7b3732e6
commit a36250ba34
4 changed files with 6 additions and 6 deletions

View file

@ -3588,7 +3588,7 @@ int main(int argc, const char **argv) // ignore_convention
pClient->RegisterInterfaces();
// create the components
IEngine *pEngine = CreateEngine("DDNet", Silent);
IEngine *pEngine = CreateEngine("DDNet", Silent, 1);
IConsole *pConsole = CreateConsole(CFGFLAG_CLIENT);
IStorage *pStorage = CreateStorage("Teeworlds", IStorage::STORAGETYPE_CLIENT, argc, argv); // ignore_convention
IConfig *pConfig = CreateConfig();

View file

@ -34,6 +34,6 @@ public:
virtual void AddJob(std::shared_ptr<IJob> pJob) = 0;
};
extern IEngine *CreateEngine(const char *pAppname, bool Silent);
extern IEngine *CreateEngine(const char *pAppname, bool Silent, int Jobs);
#endif

View file

@ -2859,7 +2859,7 @@ int main(int argc, const char **argv) // ignore_convention
IKernel *pKernel = IKernel::Create();
// create the components
IEngine *pEngine = CreateEngine("DDNet", Silent);
IEngine *pEngine = CreateEngine("DDNet", Silent, 2);
IEngineMap *pEngineMap = CreateEngineMap();
IGameServer *pGameServer = CreateGameServer();
IConsole *pConsole = CreateConsole(CFGFLAG_SERVER|CFGFLAG_ECON);

View file

@ -54,7 +54,7 @@ public:
}
}
CEngine(const char *pAppname, bool Silent)
CEngine(const char *pAppname, bool Silent, int Jobs)
{
if(!Silent)
dbg_logger_stdout();
@ -74,7 +74,7 @@ public:
net_init();
CNetBase::Init();
m_JobPool.Init(1);
m_JobPool.Init(Jobs);
m_Logging = false;
}
@ -105,4 +105,4 @@ public:
}
};
IEngine *CreateEngine(const char *pAppname, bool Silent) { return new CEngine(pAppname, Silent); }
IEngine *CreateEngine(const char *pAppname, bool Silent, int Jobs) { return new CEngine(pAppname, Silent, Jobs); }