cosmopolitan/test/libc/thread
Justine Tunney 2f48a02b44
Make recursive mutexes faster
Recursive mutexes now go as fast as normal mutexes. The tradeoff is they
are no longer safe to use in signal handlers. However you can still have
signal safe mutexes if you set your mutex to both recursive and pshared.
You can also make functions that use recursive mutexes signal safe using
sigprocmask to ensure recursion doesn't happen due to any signal handler

The impact of this change is that, on Windows, many functions which edit
the file descriptor table rely on recursive mutexes, e.g. open(). If you
develop your app so it uses pread() and pwrite() then your app should go
very fast when performing a heavily multithreaded and contended workload

For example, when scaling to 40+ cores, *NSYNC mutexes can go as much as
1000x faster (in CPU time) than the naive recursive lock implementation.
Now recursive will use *NSYNC under the hood when it's possible to do so
2024-09-10 00:08:59 -07:00
..
async_test.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
BUILD.mk Implement proper time zone support 2024-05-04 23:06:37 -07:00
footek_test.c Make recursive mutexes faster 2024-09-10 00:08:59 -07:00
makecontext_test.c Release Cosmopolitan v3.6.0 2024-07-23 03:28:19 -07:00
nsync_test.c Introduce pthread_condattr_setclock() 2024-09-02 23:45:42 -07:00
pthread_atfork_test.c Remove __threaded variable 2024-07-28 23:43:30 -07:00
pthread_attr_setsigmask_np_test.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_barrier_wait_test.c Bring back gc() function 2024-01-08 10:26:28 -08:00
pthread_cancel_deferred_cond_test.c Make recursive mutexes faster 2024-09-10 00:08:59 -07:00
pthread_cancel_masked_cond_test.c Improve multithreading 2024-07-21 14:40:45 -07:00
pthread_cancel_masked_read_test.c Improve multithreading 2024-07-21 14:40:45 -07:00
pthread_cancel_test.c Make recursive mutexes faster 2024-09-10 00:08:59 -07:00
pthread_cond_signal_test.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
pthread_cond_timedwait_test.c Introduce pthread_condattr_setclock() 2024-09-02 23:45:42 -07:00
pthread_create_inherit_mask_test.c Improve multithreading 2024-07-21 14:40:45 -07:00
pthread_create_test.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
pthread_detach_test.c Improve multithreading 2024-07-21 14:40:45 -07:00
pthread_exit_test.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
pthread_getunique_np_test.c Make POSIX threads improvements 2024-06-30 15:38:59 -07:00
pthread_key_create_test.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pthread_kill_test.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
pthread_rwlock_rdlock_test.c Run clang-format (#1197) 2024-06-01 16:30:43 -04:00
pthread_setname_np_test.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
sem_open_test.c Bring back gc() function 2024-01-08 10:26:28 -08:00
sem_timedwait_test.c Make realloc() go 100x faster on Linux/NetBSD 2024-07-07 12:40:30 -07:00
setitimer_test.c Introduce pthread_condattr_setclock() 2024-09-02 23:45:42 -07:00
tls_dtor_test.cc vim spells the c++ filetype 'cpp' 2024-04-24 13:56:37 -07:00