In spite of its simplicity, a shared data structure such as this offers ample opportunity for data race conditions. Notice that the Enqueue (Dequeue) operation writes (reads) the referenced queue location before updating the qWR (qRD) pointer. The order of operations is important ! As presented, the implementation assumes a single reader and a single writer. In a multireader or multi-writer situation (e.g. with multiple threads) a lock variable is required to prevent data races. In such a situation, the interrupt handler may not utilize a lock and hence must have exclusive access to one end of the queue