C# Producer-Consumer using Semaphores
问题 Inspired by The Little Book of Semaphores, I decided to implement the Producer-Consumer problem using Semaphores. I specifically want to be able to stop all Worker threads at will. I've tested my methodolodgy extensively and can't find anything faulty. Following code is a prototype for testing and can be ran as a Console application: using System; using System.Collections.Concurrent; using System.Threading; using NUnit.Framework; public class ProducerConsumer { private static readonly int