* push only modifies write pointer
* pop only modifies read pointer
* when pushing, update write pointer after writing the data; so that concurrent pop does not detect availability of new item too early
* when popping, update read pointer before returning the pointer to the data; so that concurrent push detects the full condition before overwriting the returned data
* unless you can make it atomic with say 256-long FIFO, calculate the magical "+1 with wrap" with local, temporary variables and make sure assignment into the global pointer or index is atomic
* no volatile needed
* no disabling of interrupts needed, given that:
* make pushes from one thread (e.g.; if from ISRs, they have to be same priority level not to pre-empt each other)
* make pops from one thread (again, if from ISRs, same priority level).
* push and pop threads can be of course different from each other.
Feel free to correct me, probably got something wrong anyway. In any case, I think I have had zero problems with FIFOs, they are an excellent way to transfer data asynchronously between two threads, but one needs the fixed roles of one pusher thread and one popper thread.