freebsd-nq/include
Kris Kennaway 2017a7cdfe Add a new "non-portable" mutex type, PTHREAD_MUTEX_ADAPTIVE_NP. This
is also implemented in glibc and is used by a number of existing
applications (mysql, firefox, etc).

This mutex type is a default mutex with the additional property that
it spins briefly when attempting to acquire a contested lock, doing
trylock operations in userland before entering the kernel to block if
eventually unsuccessful.

The expectation is that applications requesting this mutex type know
that the mutex is likely to be only held for very brief periods, so it
is faster to spin in userland and probably succeed in acquiring the
mutex, than to enter the kernel and sleep, only to be woken up almost
immediately.  This can help significantly in certain cases when
pthread mutexes are heavily contended and held for brief durations
(such as mysql).

Spin up to 200 times before entering the kernel, which represents only
a few us on modern CPUs.  No performance degradation was observed with
this value and it is sufficient to avoid a large performance drop in
mysql performance in the heavily contended pthread mutex case.

The libkse implementation is a NOP.

Reviewed by:      jeff
MFC after:        3 days
2007-10-29 21:01:47 +00:00
..
arpa Remove old prototypes for addr2ascii() and ascii2addr(), functions which no 2007-08-24 20:25:52 +00:00
gssapi
protocols
rpc
rpcsvc
_ctype.h Micro-optimization of prev. commit, change 2007-10-27 22:32:27 +00:00
a.out.h
ar.h
assert.h
bitstring.h
complex.h
cpio.h
ctype.h The problem is: currently our single byte ctype(3) functions are broken 2007-10-13 16:28:22 +00:00
db.h
dirent.h
dlfcn.h
elf-hints.h
elf.h
err.h
fmtmsg.h
fnmatch.h
fstab.h
fts.h
ftw.h
getopt.h
glob.h
grp.h
gssapi.h
hesiod.h
histedit.h Use tabs after #define. 2007-06-11 06:25:19 +00:00
ieeefp.h
ifaddrs.h
inttypes.h
iso646.h
kenv.h
langinfo.h
libgen.h
limits.h
link.h
locale.h
Makefile Install the forgotten /usr/include/geom/multipath/ header. 2007-10-01 18:07:29 +00:00
malloc_np.h
malloc.h Traditionally work in the -traditional case. 2001-11-07 23:14:31 +00:00
memory.h
monetary.h Fix an error which prevented ssize_t from becoming defined. Add 2002-09-20 08:22:48 +00:00
mpool.h
mqueue.h
ndbm.h
netconfig.h
netdb.h
nl_types.h
nlist.h
nss.h
nsswitch.h
paths.h Add _PATH_FWMEM for libkvm. 2007-06-11 02:21:18 +00:00
printf.h
proc_service.h
pthread_np.h Remove 3rd clause and renumber after getting permission from the 2007-10-29 00:31:54 +00:00
pthread.h Add a new "non-portable" mutex type, PTHREAD_MUTEX_ADAPTIVE_NP. This 2007-10-29 21:01:47 +00:00
pwd.h
ranlib.h
readpassphrase.h
regex.h
regexp.h
res_update.h
resolv.h
runetype.h
search.h
setjmp.h
sgtty.h
signal.h
stab.h
stdbool.h
stddef.h
stdio.h
stdlib.h Significantly reduce the memory leak as noted in BUGS section for 2007-07-04 00:00:41 +00:00
string.h
stringlist.h
strings.h
sysexits.h
tar.h
tgmath.h
time.h
timeconv.h
timers.h
ttyent.h
ulimit.h
unistd.h
utime.h
utmp.h
uuid.h
varargs.h
vis.h
wchar.h
wctype.h Back out iswascii change from prev. commit, iswascii was right, 2007-10-14 10:23:54 +00:00
wordexp.h