</>EmbeddedInterview

How do you implement a lock-free stack?

MediumCoding: Concurrency Primitives

Use atomic compare-and-swap on the head pointer with safe memory reclamation, such as hazard pointers, to prevent use-after-free and ABA hazards.