Implement a lock-free queue base on the algorithm by John D. Valois. For the details of the algorithm see the PDF file.