EAGAIN Insufficient resources to create another thread.
EAGAIN A system-imposed limit on the number of threads was encountered. There are a number of limits that may trigger this error: the RLIMIT_NPROC soft resource limit (set via setrlimit(2)), which limits the number of pro‐
cesses and threads for a real user ID, was reached; the kernel's system-wide limit on the number of processes and threads, /proc/sys/kernel/threads-max, was reached (see proc(5)); or the maximum number of PIDs,
/proc/sys/kernel/pid_max, was reached (see proc(5)).
简单看一下CPython的源代码处理threads表明,当线程创建失败时,解释器不会delving into details太多。它只是提高了你看到的RuntimeError。你知道吗
根据
pthread_create
手册页,线程创建可能会失败,并有以下错误代码和原因。你知道吗我瞎猜你是在第一个问题上而不是在第二个问题上。分配新线程的内存可能不足。你知道吗
关于线程创建失败的更深入的解释可以在this link中找到。你知道吗
不过,这是瞎猜。解释器更详细的错误处理肯定会有所帮助。你知道吗
相关问题 更多 >
编程相关推荐