[dba-VB] TPL - real life project experience note

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Fri Sep 2 19:51:05 CDT 2011


Hi All --

Just wanted to share my experience in using .NET 4.0 Task Parallel Library
(TPL):

http://msdn.microsoft.com/en-us/library/dd460693.aspx

I have recently developed and released to a customer an advanced WinForms
project/application having running dozen of parallel tasks

- getting data from external data sources/web services and local lookup
databases, 
- coordinating data, 
- CRUD-ing results into MS SQL 2008 back-end and log file, 
- displaying progress on WinForm...

I have used .NET 4.0 C# and TPL - the following classes:

- System.Threading.Tasks.Task
- System.Collections.Concurrent.ConcurrentBag<T>
- System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>
- System.Threading.Barrier
- C# lock statement

and 

- System.ComponentModel.BackgroundWorker to activate and run the main thread
"talking to" WinForms UI via Invoke.

TPL and related data structures and classes help to significantly simplify
coordination of the parallel tasks execution, still programming of
coordinated parallel tasks' execution is rather advanced activity - plan
one-two weeks of "learning by doing" if/when you'll find you wanted to use
TPL in your projects...

Thank you.

--
Shamil
 




More information about the dba-VB mailing list