I ran into a problem where repeatedly spawning tasks would lead to no new thread spawns working, even when those threads had already exited.
Basically kill_by_thread (the exit(0) path) frees the thread from the scheduler maps but never unmaps its stack region from the task's address space. So every spawned thread that has exited permanently leaks one stack, exhausting the task's address space after a handful of spawns.
I ran into a problem where repeatedly spawning tasks would lead to no new thread spawns working, even when those threads had already exited.
Basically
kill_by_thread(theexit(0)path) frees the thread from the scheduler maps but never unmaps its stack region from the task's address space. So every spawned thread that has exited permanently leaks one stack, exhausting the task's address space after a handful of spawns.