mirror_zfs/lib/libzpool
Etienne Dechamps 0aebd4f9e3 Create threads in detached state in userspace.
Currently, thread_create(), when called in userspace, creates a
joinable (i.e. not detached thread). This is the pthread default.

Unfortunately, this does not reproduce kthreads behavior (kthreads
are always detached). In addition, this contradicts the original
Solaris code which creates userspace threads in detached mode.

These joinable threads are never joined, which leads to a leakage of
pthread thread objects ("zombie threads"). This in turn results in
excessive ressource consumption, and possible ressource exhaustion in
extreme cases (e.g. long ztest runs).

This patch fixes the issue by creating userspace threads in detached
mode. The only exception is ztest worker threads which are meant to be
joinable.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #989
2012-10-03 13:32:48 -07:00
..
kernel.c Create threads in detached state in userspace. 2012-10-03 13:32:48 -07:00
Makefile.am Add .zfs control directory 2012-03-22 13:03:47 -07:00
taskq.c Illumos #734: Use taskq_dispatch_ent() interface 2011-12-14 09:19:30 -08:00
util.c Fix gcc cast warnings 2010-08-27 15:33:32 -07:00