在.NET线程安全的阻塞队列实现队列、线程、安全、NET

2023-09-02 23:42:35 作者:尽欢

我在寻找线程安全的阻塞队列的.NET实现。 通过线程安全阻塞队列,我的意思是: - 到队列线程安全的访问,其中出列方法调用块一个线程,直到另一个线程看跌期权(排队)一定值

I'm looking for an implementation of thread-safe blocking queue for .NET. By "thread-safe blocking queue" I mean: - thread-safe access to a queue where Dequeue method call blocks a thread untill other thread puts (Enqueue) some value.

到了那一刻我心中已经发现这一个: http://www.eggheadcafe.com/articles/20060414.asp (但它是.NET 1.1)。

By the moment I'v found this one: http://www.eggheadcafe.com/articles/20060414.asp (But it's for .NET 1.1).

可能有人评论/批评这个实现的正确性。 或者提出一些另外一个。 先谢谢了。

Could someone comment/criticize correctness of this implementation. Or suggest some another one. Thanks in advance.

推荐答案

这个怎么样一个Creating一种阻塞队列,.NET ?

如果你需要它的.NET 1.1(我不知道从问题),只是下降的仿制药和替换 T 对象

If you need it for .NET 1.1 (I wasn't sure from the question), just drop the generics and replace T with object.

 
精彩推荐
图片推荐