I strongly doubt you&#x27;re going to build a faster thread-safe workqueue by adding spinlocks to it, but if you think what I wrote is too slow, feel free to build something faster and show the speed difference in a benchmark.  You can use the code in test&#x2F; if you&#x27;d like.<p>The code I wrote does leave an optimization or two on the table.  Apple&#x27;s lockfree queue in GCD is faster than mine because of batching.  It also has a ton more features, including being (IIRC) MPSC.