]> git.ipfire.org Git - thirdparty/openssl.git/commit
Optimize Windows RCU thread signalling.
authorMilan Broz <gmazyland@gmail.com>
Wed, 11 Mar 2026 22:03:36 +0000 (23:03 +0100)
committerTomas Mraz <tomas@openssl.foundation>
Fri, 13 Mar 2026 17:26:01 +0000 (18:26 +0100)
commitdb4ecbbd0a3ce7d9a81738df0b2ddf771cb5f0a6
treefb243aa3a61a208536ee8cb3c7b80ffb0d6c3f26
parentface2e7654d7e705e1a4d178a83b81189021b8d2
Optimize Windows RCU thread signalling.

With the pthread variant, a thread truly wakes up after
the pthread_mutex_unlock call, even if pthread_cond_signal
is called before.

This is not true for the Windows variant. The thread is
woken up in WakeConditionVariable but goes back to sleep.
Reordering (signalling thread after unlocking) should save
some time during transitions and should be safe in this context.

The speedup is visible on lhash_test, running on many CPUs
(on 32 cores, a speedup from 1:40 to 1:05 minutes on test hw).

Co-Authored-By: Claude Opus 4.6 Extended <noreply@anthropic.com>
Signed-off-by: Milan Broz <gmazyland@gmail.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Fri Mar 13 17:25:49 2026
(Merged from https://github.com/openssl/openssl/pull/30388)

(cherry picked from commit cefa8bb0ac6b2a83b4e57de2b5c40ac939cf1f95)
crypto/threads_win.c