65.9K
CodeProject is changing. Read more.
Home

Simple Blocking Queue for Thread Communication and Inter-thread Invocation

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.67/5 (5 votes)

Jan 24, 2011

CPOL
viewsIcon

8600

In .NET 4.0, you can use:New Concurrent.BlockingCollection(New Queue)This even has an option on the constructor to let you specify a maximum queue depth. If it reaches this depth, a call to Add will block until the consumer thread takes something out of the queue.

In .NET 4.0, you can use:
New Concurrent.BlockingCollection(New Queue)
This even has an option on the constructor to let you specify a maximum queue depth. If it reaches this depth, a call to Add will block until the consumer thread takes something out of the queue.