Spinlock (software-only)
- turn only ping-pong like one-to-one problem
- flag only symultaniously raising flag problem
- Peterson's algorithm use flag and turn variable
spinlock (hardware atomic)
by hardware support atomic operation
atomic operation: cannot be disturbed
acquire()/lock(): before critical section
release()/unlock(): after critical section
Lock (computer science)
In computer science, a lock or mutex (from mutual exclusion) is a synchronization primitive: a mechanism that enforces limits on access to a resource when there are many threads of execution. A lock is designed to enforce a mutual exclusion concurrency control policy, and with a variety of possible methods there exists multiple unique implementations for different applications.
https://en.wikipedia.org/wiki/Lock_(computer_science)

Seonglae Cho