Reasons For Locality
There are several reasons for locality. These reasons are either goals to achieve or circumstances to accept, depending on the aspect. The reasons below are not disjoint; in fact, the list below goes from the most general case to special cases.
- Predictability: In fact, locality is merely one type of predictable behavior in computer systems. Luckily, many of the practical problems are decidable and hence the corresponding program can behave predictably, if it is well written.
- Structure of the program: Locality occurs often because of the way in which computer programs are created, for handling decidable problems. Generally, related data is stored in nearby locations in storage. One common pattern in computing involves the processing of several items, one at a time. This means that if a lot of processing is done, the single item will be accessed more than once, thus leading to temporal locality of reference. Furthermore, moving to the next item implies that the next item will be read, hence spatial locality of reference, since memory locations are typically read in batches.
- Linear data structures: Locality often occurs because code contains loops that tend to reference arrays or other data structures by indices. Sequential locality, a special case of spatial locality, occurs when relevant data elements are arranged and accessed linearly. For example, the simple traversal of elements in a one-dimensional array, from the base address to the highest element would exploit the sequential locality of the array in memory. The more general equidistant locality occurs when the linear traversal is over a longer area of adjacent data structures having identical structure and size, and in addition to this, not the whole structures are in access, but only the mutually corresponding same elements of the structures. This is the case when a matrix is represented as a sequential matrix of rows and the requirement is to access a single column of the matrix.
Read more about this topic: Locality Of Reference
Famous quotes containing the words reasons for, reasons and/or locality:
“Could truth perhaps be a woman who has reasons for not permitting her reasons to be seen? Could her name perhaps beto speak GreekBaubo?... Oh, those Greeks! They understood how to live: to do that it is necessary to stop bravely at the surface, the fold, the skin, to adore the appearance, to believe in forms, in tones, in words, in the whole Olympus of appearance! Those Greeks were superficialout of profundity!”
—Friedrich Nietzsche (18441900)
“There is no way of conveying to the corpse the reasons you have made him oneyou have the corpse, and you are, thereafter, at the mercy of a fact which missed the truth, which means that the corpse has you.”
—James Baldwin (19241987)
“The most interesting thing which I heard of, in this township of Hull, was an unfailing spring, whose locality was pointed out to me on the side of a distant hill, as I was panting along the shore, though I did not visit it. Perhaps, if I should go through Rome, it would be some spring on the Capitoline Hill I should remember the longest.”
—Henry David Thoreau (18171862)