Commit Graph

10 Commits

Author SHA1 Message Date
Paul Davis
a486fba3e9 std::atomic - 2nd batch of changes to convert from glib to std::atomic 2023-03-24 14:19:15 -06:00
Paul Davis
4ba4cd69ff switch from glib atomic to std::atomic (libs edition) 2023-03-24 14:19:15 -06:00
Robin Gareus
5ca76789c5 Allow to query capacity of MPMC queue
This is in preparation to grow the queue as needed.
2022-05-12 00:40:31 +02:00
Robin Gareus
bed992d55f Minimize false sharing of MPMC queue variables 2021-06-07 23:40:29 +02:00
Robin Gareus
5cec55da2e Micro-optimization: std::atomic<> vs glib
glib atomic operations include a complete act as a full
compiler and (where appropriate) hardware memory barrier.

std::atomic<> allows dedicated acquire and release barrier
semantics which are not available with glib.
2021-06-07 20:44:29 +02:00
Robin Gareus
1eb6b82b9f Prevent L1 cache line evicion in MPMC queue
This reduces cache coherence overhead of the queue
2021-06-07 16:05:42 +02:00
Robin Gareus
cc7b8b1bc5 gcc-11 compat, volatile atomic variables (1/2)
"While 'atomic' has a volatile qualifier, this is a historical
artifact and the pointer passed to it should not be volatile."

Furthermore "It is very important that all accesses to a
particular integer or pointer be performed using only this API"
(from https://developer.gnome.org/glib/2.68/glib-Atomic-Operations.html)

Hence initialization of atomic variables is changed to also use
this API, instead of directly initializing the value.

This also fixes a few cases where atomic variables were
accessed directly.

see also libs/pbd/pbd/g_atomic_compat.h
2021-03-22 15:30:07 +01:00
Robin Gareus
6d950d15ba Use signed int for atomic operations -- #8314 2020-07-16 16:13:21 +02:00
Robin Gareus
0301c47f6b Update core library GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
Robin Gareus
929ecf622b Add lock-free multiple producer multiple reader queue 2019-07-10 20:21:06 +02:00