Friday, August 30, 2013

Event-Receiving 2nd Thread like GUI-less Form?

.NET 4.0 added a bunch of these in System.Collections.Concurrent.


BlockingCollection<t>Class</t>


A call to Take may block until an item is available to be removed or the token is canceled.


The order in which an item is removed depends on the type of collection used to create the BlockingCollection<T> instance. When you create a BlockingCollection<T> object, you can specify the type of collection to use. For example, you could specify a ConcurrentConcurrentQueue object for first in, first out (FIFO) behavior, or a ConcurrentStack<T> object for last in, first out (LIFO) behavior. You can use any collection class that implements the IProducerConsumerCollection<T> interface. The default collection type for BlockingCollection<T> is ConcurrentQueue<T> .


BlockingCollection<t>.Take </t>


David




David http://blogs.msdn.com/b/dbrowne/



No comments:

Post a Comment