Whilst working on improving Poodle’s crawler I ran into a nasty problem. I had multiple threads all producing and consuming content from a shared “queue”.
Note: This is a slightly weird case of producer and consumer in one. Essentially you can’t stop processing until all the input has been consumed and processed (as the last item might generate more content for processing).