Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: What's the difference between a cache and a buffer?
1 point by boppo1 on Oct 7, 2023 | hide | past | favorite | 2 comments
Is it a physical hardware difference? Is it just a convention? I haven't read 'What every programmer should know about memory' yet, but I've read K&R and Stroustrup's principles, and while that lifted the curtain on a lot of things for me, this one is still elusive.


A buffer is just a logical place in the address space, whereas a cache is a physical device that uses a relatively small amount of fast but costly technology to allow a much larger amount of cheaper, slower memory to just seem faster. I say "seem", because the trick only works by taking advantage of locality of reference


In what context? What cache(s) and what buffer(s) are you asking about?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: