Go
64 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- 2.8 sync.Mutexhistorical
Mutex provides mutual exclusion, implements Locker, and starts unlocked at its zero value. These notes cover locking, unlocking, and implementation details.
- 2.9 sync.RWMutexhistorical
RWMutex distinguishes read and write locks, acquired with RLock and Lock. These notes record usage and implementation.
- 2.10 sync.Condhistorical
Cond is Go's condition variable, used with a lock to coordinate waiting and notification. These notes compare it with Java's Condition.
- 2.11 atomichistorical
Atomicity treats an operation or group of operations as a whole. These notes examine Go atomic operations in concurrent access.
- 2.12 channelhistorical
Concurrent programs can coordinate through shared memory or message passing. These notes introduce Go channels through those two models.
- 2.13 concurrenthistorical
Execution order within a goroutine differs from visibility across goroutines. These notes organize Go concurrency constraints through synchronization events.
- 2.14 goroutinehistorical
Goroutines are user-level execution units implemented by Go. These notes connect them with processes and threads and record their creation and use.
- 2.15 Goroutine Poolhistorical
A goroutine pool reuses existing goroutines. These notes compare creation, destruction, and reuse costs before discussing when pooling is useful.
- 3.1 GMPhistorical
GMP: The coroutine scheduling model in Golang: given M threads and N goroutines, how should goroutines be assigned to threads for execution?
- 3.2 Escape Analysishistorical
Objects created in Java or C++ are generally allocated on the heap, while objects created with new in Golang are allocated on the heap or stack according to escape analysis.