Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_join.html">opengroup page for pthread_join</a>,</p> <blockquote> <p>The pthread_join() function provides a simple mechanism allowing an application to wait for a thread to terminate. After the thread terminates, the application may then choose to clean up resources that were used by the thread. For instance, after pthread_join() returns, any application-provided stack storage could be reclaimed.</p> <p>The pthread_join() or pthread_detach() function should eventually be called for every thread that is created with the detachstate attribute set to PTHREAD_CREATE_JOINABLE so that storage associated with the thread may be reclaimed.</p> </blockquote> <p>and from the <a href="http://linux.die.net/man/3/pthread_join">man page of pthread_join</a></p> <blockquote> <p>Failure to join with a thread that is joinable (i.e., one that is not detached), pro‐ duces a "zombie thread". Avoid doing this, since each zombie thread consumes some system resources, and when enough zombie threads have accumulated, it will no longer be possible to create new threads (or processes).</p> <p>There is no pthreads analog of waitpid(-1, &amp;status, 0), that is, "join with any ter‐ minated thread". </p> <p>If you believe you need this functionality, you probably need to rethink your application design.</p> </blockquote> <p>If you do <a href="http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_detach.html">pthread_detach</a>,</p> <blockquote> <p>The pthread_detach() function shall indicate to the implementation that storage for the thread thread can be reclaimed when that thread terminates</p> </blockquote> <p>If you don't <code>detach</code> or <code>join</code> a <code>joinable</code> thread, it can cause waste of resources</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload