![]() While (cq.TryDequeue(out localValue)) localSum += localValue The following example shows how to use a ConcurrentQueue to enqueue and dequeue items: using System ĬoncurrentQueue cq = new ConcurrentQueue() IProducerConsumerCollection IEnumerable IReadOnl圜ollection ICollection IEnumerable Examples Implements ICollection, IEnumerable(Of T), IProducerConsumerCollection(Of T) Type Parameters Implements IEnumerable(Of T), IProducerConsumerCollection(Of T), IReadOnl圜ollection(Of T) Public Class ConcurrentQueue(Of T) Implements IEnumerable(Of T), IProducerConsumerCollection(Of T) Public Class ConcurrentQueue(Of T) Implements ICollection, IEnumerable(Of T), IProducerConsumerCollection(Of T), IReadOnl圜ollection(Of T) Public Class ConcurrentQueue(Of T) Interface IEnumerable Public Class ConcurrentQueue(Of T) Interface IReadOnl圜ollection type ConcurrentQueue = class ![]() ![]() Public class ConcurrentQueue :, , 圜ollection public class ConcurrentQueue :, , public class ConcurrentQueue :, , 圜ollection type ConcurrentQueue = class Public ref class ConcurrentQueue : System::Collections::Concurrent::IProducerConsumerCollection, System::Collections::Generic::IEnumerable, System::Collections::ICollection public class ConcurrentQueue :, , 圜ollection, Public ref class ConcurrentQueue : System::Collections::Concurrent::IProducerConsumerCollection, System::Collections::Generic::IEnumerable, System::Collections::Generic::IReadOnl圜ollection generic Public ref class ConcurrentQueue : System::Collections::Concurrent::IProducerConsumerCollection, System::Collections::Generic::IEnumerable generic Public ref class ConcurrentQueue : System::Collections::Concurrent::IProducerConsumerCollection, System::Collections::Generic::IEnumerable, System::Collections::Generic::IReadOnl圜ollection, System::Collections::ICollection generic Represents a thread-safe first in-first out (FIFO) collection.
0 Comments
Leave a Reply. |