On Tue, 2009-09-15 at 14:27 +1200, Amos Jeffries wrote: > > > RefCounting done properly forms a lock on certain read-only types like > Config. Though we are currently handling that for Config by leaking > the > memory out every gap. > > SquidString is not thread-safe. But StringNG with its separate > refcounted > buffers is almost there. Each thread having a copy of StringNG sharing > a > SBuf equates to a lock with copy-on-write possibly causing issues we > need > to look at if/when we get to that scope.
General rule: you do /not/ want thread safe objectse for high usage objects like RefCount and StringNG. synchronisation is expensive; design to avoid synchronisation and hand offs as much as possible. -Rob
signature.asc
Description: This is a digitally signed message part