Re:Show HN: Revring, a circular buffer with zero memory waste
by codehero on Thursday June 18, 2015 @05:30PM
(#9741718)
Yeah your intuition is correct here. On an MSP430 (which is were I use it) the producer is in interrupt context but as a savvy redditor pointed out, I will need to enable/disable interrupts in the consumer function as well.
An unfortunate effect of this implementation is that both indices are modified by the consumer. It's not safe to write/read dats from different contexts, something that would be very useful in a driver.