Hi Aaron, On Thu, 2025-01-23 at 21:13 -0500, Aaron Merey wrote: > > > If performance suffers too much from serializing all accesses to Dwarf > > > objects, we could instead consider using an rwlock with a custom wrapper > > > that implements recursive locking. > > > > We could also use multiple locks for different parts of the > > Dwarf. Like we already do for the trees. > > > > Currently the lock is shared for accessing the > > __libdw_intern_next_unit and the alt_dwarf. > > Yes but for now I'd prefer to keep the lock logic as simple as possible > and address lock performance issues when necessary. This should make it > easier to achieve full thread-safety. >
OK, but we should clearly document what field/function a lock "protects". So please add a comment to the field/function to make clear it shouldn't be accessed/called without holding the lock (and maybe to the lock saying which fields/functions it covers). Thanks, Mark