(whoops, correcting my own post!):

> sva->refcount=0;
> sva->refcount++; // these first 2 combined if we get the implemention right
> svb->refcount=0;
> svb->refcount++; // ditto
sva->refcount++;
> ...
> if (--sva->refcount == 0) ...  // branch not taken
> if (--svb->refcount == 0) ...  // branch taken, 
> if (--sva->refcount == 0) ...  // branch taken
> 
> which I calculate as 7 writes and 5 reads.

make that 8 and 6.

Reply via email to