> because it's not a Ref. unfortunately, if it were > a Ref, it would be much faster. _xinc is deadly > slow even if there is no contention on x86.
do you have numbers to back up this claim? you are claiming that the locked XCHGL in tas (pc/l.s) called from lock (port/taslock.c) called from incref (port/chan.c) is "much faster" than the locked INCL in _xinc (pc/l.s). it seems to me that a locked memory bus is a locked memory bus. also, when up != nil (a common condition), lock does a locked INCL and DECL (_xinc and _xdec) in addition to the tas, which seems like strictly more work than a single _xinc. russ