且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

启用队列< T>并发

更新时间:2022-05-06 15:50:50

你出队的项目,如你入队他们。
您需要使用您的参数,以提高该事件。

You're dequeueing your items as you enqueue them.
You need to raise the event using your parameter.

无论它实际上是线程安全取决于你如何使用它。
如果你检查计数或检查的空虚,它不是线程安全的,不能轻易进行线程安全的。
如果不这样做,你也许可以用更简单的东西比一个队列。

Whether it's actually thread-safe depends on how you use it.
If you ever check the Count or check for emptiness, it's not threadsafe and cannot easily be made threadsafe.
If you don't, you can probably use something simpler than a queue.