[openssl/openssl] 70cdba: Add some crypto atomic pointer ops

0 views
Skip to first unread message

Neil Horman

unread,
4:45 AM (18 hours ago) 4:45 AM
to openssl...@openssl.org
Branch: refs/heads/master
Home: https://github.com/openssl/openssl
Commit: 70cdba10faa2055fc5791bddc3e12ddfbe772496
https://github.com/openssl/openssl/commit/70cdba10faa2055fc5791bddc3e12ddfbe772496
Author: Neil Horman <nho...@openssl.org>
Date: 2026-04-14 (Tue, 14 Apr 2026)

Changed paths:
M crypto/threads_none.c
M crypto/threads_pthread.c
M crypto/threads_win.c
M include/openssl/crypto.h.in

Log Message:
-----------
Add some crypto atomic pointer ops

CRYPTO_atomic_load_ptr - load a pointer value with relaxed semantics
CRYPTO_atomic_store_ptr - store a pointer value with relaxed semantics
CRYPTO_atomic_cmp_exch_ptr - cmp/exch a pointer with relaxed or acq/rel
semantics

The addition of these functions enables us to better use atomics to
replace read/write locks where we are almost always doing reads

Reviewed-by: Paul Dale <paul...@oracle.com>
Reviewed-by: Nikola Pajkovsky <nik...@openssl.org>
MergeDate: Tue Apr 14 08:29:30 2026
(Merged from https://github.com/openssl/openssl/pull/30670)


Commit: 91072b2039e844d089ad3f6e8cc1689f366ac92c
https://github.com/openssl/openssl/commit/91072b2039e844d089ad3f6e8cc1689f366ac92c
Author: Neil Horman <nho...@openssl.org>
Date: 2026-04-14 (Tue, 14 Apr 2026)

Changed paths:
M crypto/rand/rand_lib.c

Log Message:
-----------
convert rand_meth_lock to atomics

Using our previously created atomic ops, we can (almost) eliminate the
use of the rand_meth_lock. This lock guards reads/write on the
RAND_default_meth global variable, which is generally written only once
during a process lifetime. By replacing the lock with an atomic read
for reads, and an atomic compare and exchange or atomic store for
writes, we can significantly improve the execution time of
RAND_get_rand_method, which is called every time a process calls
RAND_bytes_ex()

Reviewed-by: Paul Dale <paul...@oracle.com>
Reviewed-by: Nikola Pajkovsky <nik...@openssl.org>
MergeDate: Tue Apr 14 08:29:31 2026
(Merged from https://github.com/openssl/openssl/pull/30670)


Commit: 403660257b43fb7392c7c2c14b6dd49c4c1b8caa
https://github.com/openssl/openssl/commit/403660257b43fb7392c7c2c14b6dd49c4c1b8caa
Author: Neil Horman <nho...@openssl.org>
Date: 2026-04-14 (Tue, 14 Apr 2026)

Changed paths:
M util/libcrypto.num

Log Message:
-----------
Run make update

Adds CRYPTO_atomic_load_ptr, CRYPTO_atomic_store_ptr and
CRYPTO_atomic_cmp_exch_ptr

Reviewed-by: Paul Dale <paul...@oracle.com>
Reviewed-by: Nikola Pajkovsky <nik...@openssl.org>
MergeDate: Tue Apr 14 08:29:32 2026
(Merged from https://github.com/openssl/openssl/pull/30670)


Commit: bdfac7bb669f02f441664b5f439c282f7d27569b
https://github.com/openssl/openssl/commit/bdfac7bb669f02f441664b5f439c282f7d27569b
Author: Neil Horman <nho...@openssl.org>
Date: 2026-04-14 (Tue, 14 Apr 2026)

Changed paths:
M CHANGES.md
M NEWS.md
M doc/man3/CRYPTO_THREAD_run_once.pod

Log Message:
-----------
Add docs for new atomic apis

Documents CRYPTO_atomic_load_ptr(), CRYPTO_atomic_store_ptr() and
CRYPTO_atomic_cmp_exch_ptr()

Reviewed-by: Paul Dale <paul...@oracle.com>
Reviewed-by: Nikola Pajkovsky <nik...@openssl.org>
MergeDate: Tue Apr 14 08:29:33 2026
(Merged from https://github.com/openssl/openssl/pull/30670)


Compare: https://github.com/openssl/openssl/compare/91f7d4e76eb4...bdfac7bb669f

To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications
Reply all
Reply to author
Forward
0 new messages