A method and apparatus for conditional memory ordering are disclosed. The
cost of memory ordering is reduced by determining circumstances in which
a memory ordering operation is unnecessary and avoiding the overheads of
these operations by reducing the frequency of invoking hardware memory
ordering mechanisms. Hardware instructions for implementing a conditional
memory ordering method and apparatus is described which may be
implemented in a multiprocessor environment. The conditional memory
ordering instruction executes locally using a release vector containing
release numbers for each processor in the system. The instruction first
determines whether a processor identifier of the release number is
associated with the current processor. Where it is not, a conditional
register is examined and appropriate remote synchronization operations
are commanded where necessary.