A multi-streaming processor has a plurality of streams for streaming one
or more instruction threads, a set of functional resources for processing
instructions from streams, and a lock mechanism for locking selected
memory locations shared by streams of the processor, the hardware-lock
mechanism operating to set a lock when an atomic memory sequence is
started and to clear a lock when an atomic memory sequence is completed.
In preferred embodiments the lock mechanism comprises one or more storage
locations associated with each stream of the processor, each storage
location enabled to store a memory address a lock bit, and a stall bit.
Methods for practicing the invention using the apparatus are also taught.