西维蜀黍

【Hardware】CPU Cache

CPU Cache

A CPU cache is a hardware cache used by the central processing unit (CPU) of a computer to reduce the average cost (time or energy) to access data from the main memory.[1] A cache is a smaller, faster memory, located closer to a processor core, which stores copies of the data from frequently used main memory locations. Most CPUs have a hierarchy of multiple cache levels (L1, L2, often L3, and rarely even L4), with separate instruction-specific and data-specific caches at level 1.

  ...


【Programming】Memory Model

Memory Model

In computing, a memory model describes the interactions of threads through memory and their shared use of the data.

  ...


【Golang】设计模式 - Structural - Decorator

Decorator Pattern

Decorator design pattern is a structural design pattern. It lets you provide additional functionality or decorates an object without altering that object.

换言之,客户端并不会觉得对象在装饰前和装饰后有什么不同。装饰器模式可以在不需要创造更多子类的情况下,将对象的功能加以扩展。这就是装饰器模式的模式动机。

Refer to https://swsmile.info/post/design-pattern-decorator/ for Decorator Pattern.

  ...


【Golang】设计模式 - Behavioral - Chain of Responsibility

Chain of Responsibility is behavioral design pattern that allows passing request along the chain of potential handlers until one of them handles request.

The pattern allows multiple objects to handle the request without coupling sender class to the concrete classes of the receivers. The chain can be composed dynamically at runtime with any handler that follows a standard handler interface.

  ...


【Golang】设计模式 - Behavioral - Strategy

Intent

Strategy is a behavioral design pattern that lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.

  ...