Explain how you would implement a lock-free circular buffer for communication between an interrupt service routine (ISR) and a user-space thread.