CAS-based lock-free algorithm for shared deques
Implementing Lock-Free Queues