refcount without locking?
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 09 Aug 2024 15:11:47 UTC
Hello group, I'm working on simplifying some aspects of source node tracking in pf and I thought that using reference counting would allow to simplify the code a bit by detaching the counter of states attached to a source node (currently pretending to be a reference counter too) from a reference counter (non-existent now). But I can't figure out how refcount(9) should be used. The man page for refcount(9) states: > Note that these routines do not provide any inter-CPU > synchronization or data protection for managing the counter. But most of reference counting functions use atomic operations. I understand that those operations will guarantee that reference increments and decrements will work properly over multiple threads and multiple CPUs or CPU cores. How should refcount(9) be used regarding locking? -- | pozdrawiam / regards | Powered by macOS, Debian and FreeBSD | | Kajetan Staszkiewicz | www: http://vegeta.tuxpowered.net | `----------------------^--------------------------------------'