Linux - What is ‘the principle of locality’?

What is 'the principle of locality'?

- It is a term for the phenomenon in which the same values or related storage locations are frequently accessed.

- It is also known as the locality of reference.

- The next most data items or instruction is the closest to the current data item or instruction.

- For example, a block in a file may be the closest one that is needed next. The OS can read the next block before its need and made available it on hand at the time of issuing the actual read request.

There are two types of principle of locality:

1. Temporal locality
2. Spatial locality

- Principle of locality is the type of predictable behavior which occurs in computer systems.

- Programs tend to reuse the instructions they have used recently.

1.Temporal locality:
- It refers to the reuse of specific data and resources.

2. Spatial locality:
- It refers to the use of data elements within relatively close storage locations.

- Sequential locality is a special case of spatial locality which occurs when the data elements are arranged linearly, such as one-dimensional array.
Linux - What is page fault? Its types.
What is page fault? Its types - One of the critical parts of code in the Linux kernel....
Linux - Difference between the fork() and vfork() system call
Difference between the fork() and vfork() system call - fork: Both the parent and child share all of the page tables until any one of them does a write.........
Linux - What is BSS(Block Started by Symbol)?
What is BSS(Block Started by Symbol)? - UNIX linkers produce uninitialized data segments........
Post your comment