Re: URCU feature request?
Ondřej Surý via lttng-dev <[email protected]> Tue, 2 Sep 2025 23:33:50 +0200
| Newsgroups | org.lttng.lists.lttng-dev |
|---|---|
| Message-ID | <[email protected]> |
If I understand you correctly, you can do something like this:
#undef rcu_read_lock
#define rcu_read_lock() urcu_memb_read_lock(); {
#undef rcu_read_unlock
#define rcu_read_lock() } urcu_memb_read_unlock();
(replace memb with your RCU variant of course)
and make your code declare all the RCU protected pointers inside the RCU =
critical section, e.g.
rcu_read_lock();
my_pointer *foo =3D rcu_dereference(...);
use(foo); /* valid */
rcu_read_unlock();
use(foo); /* invalid and caught by the compiler */
Ondrej
--
Ond=C5=99ej Sur=C3=BD (He/Him)
[email protected]
> On 2. 9. 2025, at 23:06, Thobias Knudsen via lttng-dev =
<[email protected]> wrote:
>=20
> Yes, that is what I'm worried about. For my case when using URCU that =
is my biggest concern, as the debug macro "library" I made checks =
everything else, if I haven't overlooked anything.
>=20