The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Hot answers tagged

4

Most L2 (and L3) caches are indexed with the physical (not virtual) address modulo a power of two that is larger than the page size. This allows different physical address colors to map to different indices, isolating replacement decisions (i.e., only accesses from the same color can cause a cache miss). The added latency from cache misses (often measured in ...


3

As Gilles points out, it's not immediately obvious what the analogue of this would be in a non-object-oriented language. Below is one suggestion. Let's say you have a function h :: (A -> B) -> C (this is using Haskell syntax). h is a higher order function and particularly it takes a function of type A -> B. The definition of h will be something ...


1

You are right that the clock speed is determined by the slowest stage. But on most architectures it is not true that fetching(or any kind of memory access in fact) takes one cycle. This is an illusion provided by the CPU to makes things manageable. In practice if your CPU tries to fetch and the operation cannot be completed in one cycle then it will stall(on ...


1

A TLB is useful for the same reason any other cache is useful: because it's very common to access the same data multiple times in quick succession. Many algorithms use the same value more than once. For example, searching requires accessing the search pattern a lot of times. Sorting a list requires comparing the same element multiple times for any (...


Only top voted, non community-wiki answers of a minimum length are eligible