add circular buffer and producer/consumer thread snippets