Hi Thorsten,
Thorsten Behrens wrote:
Jens-Heiner Rechtien <[EMAIL PROTECTED]> writes:
With UTF2 you mean "Uno Threading Framework 2"? I can see how it helps
the performance if we reduce mutex locking (especially Solar-Mutex, of
course) but naively I would assume that reference counter as
programming concept are mostly independent from that effort? Does UTF2
significantly reduce the amount of reference counter usage? How?
Not per se. And apart from that, the ref counting in _itself_ is
indeed not addressed by UTF2. But the number of _atomic_ operations
could be significantly reduced - a plain, non-locking integer
operation should be fast everywhere.
Well, but any reference counter increase/decrease still needs to be
atomic as long as they are not thread local? How can we replace them
with plain integer operations?
"Locking" in the narrow context of the x86-reference counter discussion
referred to the "lock" prefix of the "xadd" statement which locks the
bus (so that the memory location in question can't be changed by another
processor or by other means like DMA). It's not a "locking" operation in
the sense of the synchronization primitive "Lock", it's just the way x86
systems implements atomic integer operations.
Whether we should go down that road (i.e. distinguishing between
thread-safe and thread-unsafe ref counting all over the place) is a
different question though...
I really doubt that it's worth the trouble. We are talking about < 1%
gain for a potential hazardous change in case someone didn't get it
right. The one expensive case (old Intel single processor systems where
the "lock" prefix seems to be very expensive and is completely unneeded
for reference counters) is taken care for. Eliminating unneeded
reference counting itself is a worthy goal, as the improvements with the
"empty string" showed.
Heiner
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]