[gclist] RE: synchronization cost (was: Garbage collection and XML)

Manoj Plakal plakal@cs.wisc.edu
Wed, 14 Mar 2001 11:26:45 -0600


Jan-Willem Maessen wrote (Wed, Mar 14, 2001 at 11:15:08AM -0500) :
> Much discussion of CMPXCHG on Intels has gone by.  However, it's worth
> pointing out that Pentium-class processors allow you to do all sorts
> of locked operations.  From the IA-64 manual, Pentium ISA section [p
> 5-261, LOCK, if you care; the older Pentium manuals agree on this
> information]: 
> 
>   The LOCK prefix can be prepended only to the following instructions
>   and to those forms of the instructions that use a memory operand:
>   ADD, ADC, AND, BTC, BTR, BTS, CMPXCHG, DEC, INC, NEG, NOT, OR, SBB,
>   SUB, XOR, XADD, and XCHG. ...
> 
> That's a pretty long list, and one of the above instructions is
> usually what you actually want.  For example (getting back to GC
> here), BTC/BTR/BTS allow you to atomically update a shared
> allocation/mark bitmap efficiently.

	If you look at the part of the Intel manuals describing
	optimizations for the Pentium-II/III/IV, I think you'll
	find that they deprecate the use of prefixes like this.

	Manoj