TIL Portal 2 crashes if you have too many cores.๐Ÿ˜ฌ "Out of thread ids. Decrease the number of threads or increase MAX_THREAD_IDS" Googling that shows some leaked cs:go source with "const int MAX_THREAD_IDS = 128;". The game is probably allocating an ID per core, and a few more. https://t.co/UXLWJajqjW

1 min read Original article โ†—

Post

TIL Portal 2 crashes if you have too many cores.๐Ÿ˜ฌ "Out of thread ids. Decrease the number of threads or increase MAX_THREAD_IDS" Googling that shows some leaked cs:go source with "const int MAX_THREAD_IDS = 128;". The game is probably allocating an ID per core, and a few more.

Screenshot of some code on github, showing line numbers 69 through 105:

// thread creation counter.
// this is used to provide a unique threadid for each running thread in g_nThreadID ( a thread local variable ).

const int MAX_THREAD_IDS = 128;

static volatile bool s_bThreadIDAllocated[MAX_THREAD_IDS];

#if defined(_LINUX) && defined(DEDICATED)

DLL_CLASS_EXPORT __thread int g_nThreadID;

Don't miss what's happening

People on X are the first to know.

Log inSign up