Click here to Skip to main content
12,453,672 members (88,427 online)
Click here to Skip to main content
Alternatives (1)
Add your own
alternative version

Tagged as

Stats

35K views
30 bookmarked
Posted

Simple Blocking Queue for Thread Communication and Inter-thread Invocation

, 23 Jan 2011 CPOL
A generic class to be used as a conveyor for data and tasks between threads

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

24 Jan 2011
dwilliss
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Sergey Alexandrovich Kryukov
Architect
United States United States
No Biography provided

Pro
Pro
| | Privacy | Terms of Use | Mobile
Web02 | 2.8.160826.1 | Last Updated 23 Jan 2011
Article Copyright 2011 by Sergey Alexandrovich Kryukov
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid