摘要: 使用.NET的BlockingCollection来包装一个ConcurrentQueue来实现golang的channel。代码如下:public class Channel{ private BlockingCollection _buffer; public Channel() : this(1) { } public Channel(int size) { _buffer = new BlockingCollection(new ConcurrentQueue(), size); } public bool Send(T t) {... 阅读全文
posted @ 2013-12-03 21:18 visionwang 阅读(2299) 评论(0) 推荐(0) 编辑