Click here to Skip to main content
15,890,512 members

Comments by manish31383 (Top 1 by date)

manish31383 8-Nov-11 19:49pm View    
Deleted
j_alles,

Thanks for bringing in notice the Caller code. I hand typed caller so missed few things.

This code snippet is not going to execute one task(which is 1 City Object as you mentioned) 6 times. This snippet is written to start 6 threads and then execute tasks entered in the queue.

Imagine this:

<pre lang="cs">for (int i = 0; i <= 100; i++)
threadpool.AddItem(new City());</pre>

100 Cities will be printed by 6 different threads parallely.We get parallel processing and queue will be drained faster than 1 thread would have done.