| US 7,558,910 B2 | ||
| Detecting access to a memory location in a multithreaded environment | ||
| Gail A. Alverson, Seattle, Wash. (US); Charles David Callahan, II, Seattle, Wash. (US); Simon H. Kahan, Seattle, Wash. (US); Brian D. Koblenz, Seattle, Wash. (US); Allan Porterfield, Bellevue, Wash. (US); and Burton J. Smith, Seattle, Wash. (US) | ||
| Assigned to Cray Inc., Seattle, Wash. (US) | ||
| Filed on Oct. 30, 2003, as Appl. No. 10/697,128. | ||
| Application 10/697128 is a continuation of application No. 09/361671, filed on Jul. 27, 1999, granted, now 6,862,635. | ||
| Application 09/361671 is a continuation of application No. 09/192207, filed on Nov. 13, 1998, abandoned. | ||
| Prior Publication US 2005/0021898 A1, Jan. 27, 2005 | ||
| Int. Cl. G06F 13/00 (2006.01); G06F 9/34 (2006.01); G06F 9/455 (2006.01); G06F 9/46 (2006.01); G06F 3/00 (2006.01) | ||
| U.S. Cl. 711—110 [711/100; 711/145; 711/203; 718/1; 718/100; 718/102; 718/104; 710/36; 710/52; 710/54; 710/56] | 48 Claims |

| 1. A method in a computer system having a processor and a memory for implementing a circular buffer having a size, comprising:
providing a buffer having a plurality of words in the memory, each word having an associated disabled forwarding bit;
providing a pointer pointing to a word within the buffer;
providing a number of forwarding words located adjacent to an end of the buffer in the memory, each forwarding word having
an associated enabled forwarding bit and each forwarding word storing a pointer to a word within the buffer, the first forwarding
word storing a pointer pointing to the first word in the buffer, each subsequent forwarding word storing a pointer pointing
to the word in the buffer immediately following the word in the buffer pointed to by the pointer stored in the immediately
preceding forwarding word, wherein the number of forwarding words is less than or equal to the number of words in the buffer;
receiving from the processor a request to access a number of sequential words wherein a starting position for accessing data
in the buffer is based on the pointer modulo the size of the buffer, a maximum number of words of the buffer to be accessed
at a time corresponding to the number of forwarding words;
selecting the word pointed to by the pointer modulo the size of the buffer;
for each word to be accessed, starting with the selected word,
retrieving the forwarding bit associated with the word to be accessed,
when it is determined that the retrieved forwarding bit is disabled, accessing the word directly, and
when it is determined that the retrieved forwarding bit is enabled, retrieving the pointer stored in the word and directing
the access to the word within the buffer pointed to by the retrieved pointer; and
incrementing the pointer by the number of words being accessed
so that the buffer is accessed without checking for the end of the buffer.
|