Reputation: 1843
I am implementing a WPF application. In this app I have to manage different operations with Serial Ports. All this operations I want to do it in another thread but only one thread waiting for task and make a queue with all this tasks like a LooperThread in Java. I was thinking about the possibility to do a ThreadPool with only one thread size. Are there better possibilities? Thanks!
Upvotes: 1
Views: 942
Reputation: 36453
For threading the new model to use is the Task Parallel Library. If you have a bunch of independent operations that need to happen maybe have a look at TPL Dataflows and set them up as a chain of operations.
http://www.michaelfcollins3.me/blog/2013/07/18/introduction-to-the-tpl-dataflow-framework.html
Upvotes: 2