The thread resources of the joinable thread are released only after it is joined.
可连接的线程只有在被连接后 才释放线程资源。
And most likely, such a memory leak is caused by a failure to join the joinable threads.
这种内存泄漏很有可能是因未能联接可接合线程而造成的。
Let's start by reviewing POSIX threads, which can be either joinable threads or detached threads.
我们首先回顾一下POSIX线程,分为可接合线程或分离线程。
If you create a joinable thread but forget to join it, its resources or private memory are always kept in the process space and never reclaimed.
如果您创建一个可接合的线程,但是忘记联接它,其资源或私有内存一直保存在进程空间中,从未进行回收再利用。
As demonstrated in Listing 1 and 2, joinable threads are produced, but they are never joined, so each terminated joinable thread still occupies the process space, leaking the process memory.
如清单1和清单2所示,虽然生成了可接合线程,但是却未将其联接,因此每个终止的可接合线程仍然占用进程空间,泄漏进程内存。
Quorum resource is not joinable. A multi - node cluster can not be created.
无法加入仲裁资源。无法创建多节点群集。
If they are joinable threads and you haven't called the pthread_join to join them, each produced thread will leak a sizeable amount of memory (at least 10mb per stack) after its termination.
如果它们是可接合的线程,且您没有调用pthread_join来联接它们,那么在线程终止后,每个产生的线程都将泄漏大量的内存(至少每堆栈10MB)。
If they are joinable threads and you haven't called the pthread_join to join them, each produced thread will leak a sizeable amount of memory (at least 10mb per stack) after its termination.
如果它们是可接合的线程,且您没有调用pthread_join来联接它们,那么在线程终止后,每个产生的线程都将泄漏大量的内存(至少每堆栈10MB)。
应用推荐