Deep Understanding of Golang Mutex
How to implement Golang Mutex
Published in
12 min readSep 22, 2022
Before we start, we need to add several ways to implement locks.
# Semaphore.
There are P and V operations in the OS. The P operation is to change the semaphore by -1, and the V operation is to increase the semaphore by 1, so the operation mode of the semaphore is: