Yahoo Answers is shutting down on 4 May 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Is Cache and Stack the same thing?

In computer memory. If they are not the same which one is higher on the hierarchy?

2 Answers

Relevance
  • 4 years ago

    Assuming you are talking about processor internals...

    They are not the same thing, even when they are implemented with the same technology. Cache is "content-addressable memory" where entries are replaced in least-recently-used order. This is always the fastest memory technology available to the processor for the size of the cache memory, holding temporary copies of recently used main memory.

    A stack stores information in "last-in-first-out" order, so it's the *most recently used* entries that are removed first. The stack that's visible to the programmer is generally stored in main memory, rather than in high-speed memory visible only to processor hardware. However, other stacks may be used internally for handling multiple concurrent interrupts or other perhaps hardware events and actions.

    There may or may not be a hierarchy, but if there is it will certainly be cache memory that is consulted first to satisfy a request for a word from main memory. That will happen before access to a software stack stored in main memory.

  • 4 years ago

    They are both stored in your RAM chips.

Still have questions? Get answers by asking now.