12 2013 档案
摘要:使用.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) {...
阅读全文

浙公网安备 33010602011771号