bind9/lib/isc
Ondřej Surý cbbecfcc82 Add isc_trampoline API to have simple accounting around threads
The current isc_hp API uses internal tid_v variable that gets
incremented for each new thread using hazard pointers.  This tid_v
variable is then used as a index to global shared table with hazard
pointers state.  Since the tid_v is only incremented and never
decremented the table could overflow very quickly if we create set of
threads for short period of time, they finish the work and cease to
exist.  Then we create identical set of threads and so on and so on.
This is not a problem for a normal `named` operation as the set of
threads is stable, but the problematic place are the unit tests where we
test network manager or other APIs (task, timer) that create threads.

This commits adds a thin wrapper around any function called from
isc_thread_create() that adds unique-but-reusable small digit thread id
that can be used as index to f.e. hazard pointer tables.  The trampoline
wrapper ensures that the thread ids will be reused, so the highest
thread_id number doesn't grow indefinitely when threads are created and
destroyed and then created again.  This fixes the hazard pointer table
overflow on machines with many cores. [GL #2396]
2021-02-25 16:21:10 +01:00
..
include Use library constructor/destructor to initialize OpenSSL 2021-02-18 19:33:54 +01:00
netmgr Use library constructor/destructor to initialize OpenSSL 2021-02-18 19:33:54 +01:00
pthreads Add isc_trampoline API to have simple accounting around threads 2021-02-25 16:21:10 +01:00
tests Use library constructor/destructor to initialize OpenSSL 2021-02-18 19:33:54 +01:00
unix Reformat sources using clang-format-11 2020-12-08 18:36:23 +01:00
win32 Add isc_trampoline API to have simple accounting around threads 2021-02-25 16:21:10 +01:00
.gitignore [master] update gitignore files; use rev-parse to get srcid 2014-06-17 13:49:30 -07:00
aes.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
app.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
assertions.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
astack.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
backtrace.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
base32.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
base64.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
bind9.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
buffer.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
commandline.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
counter.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
crc64.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
entropy.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
entropy_private.h update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
error.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
event.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
fsaccess_common.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
fsaccess_common_p.h update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
glob.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
hash.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
heap.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
hex.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
hmac.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
hp.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
ht.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
httpd.c Fix the isc_nm_closedown() to actually close the pending connections 2020-10-22 11:37:16 -07:00
iterated_hash.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
lex.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
lib.c Add isc_trampoline API to have simple accounting around threads 2021-02-25 16:21:10 +01:00
log.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
Makefile.am Add isc_trampoline API to have simple accounting around threads 2021-02-25 16:21:10 +01:00
md.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
mem.c Address unbalanced lock/unlock 2021-02-25 13:08:07 +11:00
mem_p.h Use library constructor/destructor to initialize OpenSSL 2021-02-18 19:33:54 +01:00
mutexblock.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
netaddr.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
netscope.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
nonce.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
openssl_shim.c Refactor TLSDNS module to work with libuv/ssl directly 2021-01-25 09:19:22 +01:00
openssl_shim.h Refactor TLSDNS module to work with libuv/ssl directly 2021-01-25 09:19:22 +01:00
parseint.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
pk11.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
pk11_result.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
pool.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
portset.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
queue.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
quota.c Refactor netmgr and add more unit tests 2020-12-01 16:47:07 +01:00
radix.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
random.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
ratelimiter.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
regex.c Reformat sources using clang-format-11 2020-12-08 18:36:23 +01:00
region.c Reformat sources using clang-format-11 2020-12-08 18:36:23 +01:00
result.c netmgr: server-side TLS support 2020-11-10 14:16:27 +01:00
rwlock.c Cleanup redundant isc_rwlock_init() result checks 2021-02-03 12:22:33 +11:00
safe.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
serial.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
siphash.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
sockaddr.c netmgr: server-side TLS support 2020-11-10 14:16:27 +01:00
stats.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
string.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
symtab.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
task.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
task_p.h update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
taskpool.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
timer.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
tls.c Use library constructor/destructor to initialize OpenSSL 2021-02-18 19:33:54 +01:00
tls_p.h Use library constructor/destructor to initialize OpenSSL 2021-02-18 19:33:54 +01:00
tm.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
trampoline.c Add isc_trampoline API to have simple accounting around threads 2021-02-25 16:21:10 +01:00
trampoline_p.h Add isc_trampoline API to have simple accounting around threads 2021-02-25 16:21:10 +01:00
url.c Initial support for DNS-over-HTTP(S) 2021-02-03 12:06:17 +01:00
utf8.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00