CoWork::Pool::Pool() { ASSERT(!IsWorker()); InitThreads(CPU_Cores() + 2); free = NULL; for(int i = 0; i < SCHEDULED_MAX; i++) Free(slot[i]); quit = false; }
namespace Ini { INI_INT(port, 8001, "TCP/IP server port to listen on"); INI_STRING(ip, "0.0.0.0", "IP address to listen on"); INI_STRING(path, Nvl(GetEnv("UPP_ASSEMBLY__"), GetFileFolder(GetExeFilePath())), "Path to witz templates and static files"); INI_INT(threads, 3 * CPU_Cores() + 1, "Number of threads in each Skylark subprocess"); #ifdef _DEBUG INI_INT(prefork, 0, "Number of preforked Skylark subprocesses"); INI_INT(timeout, 0, "Timeout in seconds for Skylark event handler"); INI_BOOL(use_caching, false, "Cache compiled witz templates or other data"); INI_INT(caching, 1, "Agressivity of caching on static/** " "(0=no caching, 1=use ETag header, 2=use versioned path)"); #else INI_INT(prefork, 1, "Number of preforked Skylark subprocesses"); INI_INT(timeout, 300, "Timeout in seconds for Skylark event handler"); INI_BOOL(use_caching, true, "Cache compiled witz templates or other data"); INI_INT(caching, 1, "Agressivity of caching on static/** " "(0=no caching, 1=use ETag header, 2=use versioned path)"); #endif };
int GetHydraThreads() { return CPU_Cores(); }
int CoWork::GetPoolSize() { int n = GetPool().threads.GetCount(); return n ? n : CPU_Cores() + 2; }