Lock Free Queue

Author: Fredrik Ludvigsen (Steinbitglis)

Description
This queue lets you simultaneously enqueue and dequeue items, even from multiple threads.

Usage
Instantiate a LockFreeQueue for your specific data type, and use the queue to send stuff one way to / from other worker threads etc.

Use two queues for two way communication with your custom threads.

Compatibility note
Interlocked.CompareExchange does not play nice with AOT compilation, so be careful when working with consoles etc.