缓存和缓冲都是一种数据结构,但是其作用不一样,缓存一般可以用map实现,但是缓冲一般应用queue实现。以下对比了两者区别:

参考: https://en.wikipedia.org/wiki/Data_buffer https://en.wikipedia.org/wiki/Cache_(computing) http://www.differencebetween.net/technology/hardware-technology/difference-between-cache-and-buffer/