htl: Reimplement GSCOPE

System Internals / glibc - Sergey Bugaev [] - 15 September 2021 23:04 UTC

This is a new implementation of GSCOPE which largely mirrors its NPTL counterpart. Same as in NPTL, instead of a global flag shared between threads, there is now a per-thread GSCOPE flag stored in each thread's TCB. This makes entering and exiting a GSCOPE faster at the expense of making THREAD_GSCOPE_WAIT () slower.

The largest win is the elimination of many redundant gsync_wake () RPC calls; previously, even simplest programs would make dozens of fully redundant gsync_wake () calls.

ed2f9aaf5e htl: Reimplement GSCOPE
sysdeps/htl/dl-thread_gscope_wait.c | 55 +++++++++++++++++++++++++++++++++++++
sysdeps/mach/hurd/i386/tls.h | 21 ++++++++++++++
sysdeps/mach/hurd/tls.h | 20 --------------
3 files changed, 76 insertions(+), 20 deletions(-)


  • Share