[openssl/openssl] d0e1a0: RCU lock implementation

Neil Horman noreply at github.com
Thu Feb 1 13:51:23 UTC 2024


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: d0e1a0ae701cfaca7f3dd3bf28a3f934a6408813
      https://github.com/openssl/openssl/commit/d0e1a0ae701cfaca7f3dd3bf28a3f934a6408813
  Author: Neil Horman <nhorman at openssl.org>
  Date:   2024-02-01 (Thu, 01 Feb 2024)

  Changed paths:
    A crypto/rcu_internal.h
    M crypto/threads_none.c
    M crypto/threads_pthread.c
    M crypto/threads_win.c
    A doc/internal/man3/ossl_rcu_lock_new.pod
    A include/internal/rcu.h
    M test/threadstest.c

  Log Message:
  -----------
  RCU lock implementation

Introduce an RCU lock implementation as an alternative locking mechanism
to openssl.  The api is documented in the ossl_rcu.pod
file

Read side implementaiton is comparable to that of RWLOCKS:
ossl_rcu_read_lock(lock);
<
critical section in which data can be accessed via
ossl_derefrence
>
ossl_rcu_read_unlock(lock);

Write side implementation is:
ossl_rcu_write_lock(lock);
<
critical section in which data can be updated via
ossl_assign_pointer
and stale data can optionally be scheduled for removal
via ossl_rcu_call
>
ossl_rcu_write_unlock(lock);
...
ossl_synchronize_rcu(lock);

ossl_rcu_call fixup

Reviewed-by: Hugo Landau <hlandau at openssl.org>
Reviewed-by: Matt Caswell <matt at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22729)


  Commit: 504e72fc1a1432d5266bd6e8909648c49884a36c
      https://github.com/openssl/openssl/commit/504e72fc1a1432d5266bd6e8909648c49884a36c
  Author: Neil Horman <nhorman at openssl.org>
  Date:   2024-02-01 (Thu, 01 Feb 2024)

  Changed paths:
    M crypto/conf/conf_mod.c

  Log Message:
  -----------
  Add exemplar use case for rcu locks

To demonstrate the use of RCU locks, convert CONF_MOD api to using rcu
rather than RW locks

Reviewed-by: Hugo Landau <hlandau at openssl.org>
Reviewed-by: Matt Caswell <matt at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22729)


Compare: https://github.com/openssl/openssl/compare/de18dc3a635c...504e72fc1a14


More information about the openssl-commits mailing list