[gnutls-devel] GnuTLS | priority: rework config reloading logic and locking (!1483)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Tue Nov 2 09:32:46 CET 2021

Daiki Ueno commented on a discussion on lib/priority.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1483#note_720721773

>  			 * allow it to be updated without restarting
>  			 * all applications
>  			 */
> +			GNUTLS_STATIC_MUTEX_LOCK(system_wide_config_mutex);
>  			_gnutls_update_system_priorities();

Let me add a bit of the context of this change: in the previous version, we had mutex lock/unlock in `_gnutls_update_system_priorities`. This was not sufficient, because in the following line we have a read access with `_name_val_array_value`. So this is the approach to keep the critical section minimal.

On the other hand, I tend to think this should be protected with an RW lock instead of mutex (because there could be multiple reader of the global variables, while there should be a single writer). The current GnuTLS code base doesn't have any abstraction of RW lock, but maybe we could import `pthread-rwlock` from Gnulib.

Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1483#note_720721773
You're receiving this email because of your account on gitlab.com.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20211102/9a2d2a34/attachment-0001.html>

More information about the Gnutls-devel mailing list