Paul it is very likely that Threading will help it will probably do nothing or even slow this down ( due to lock contention and contextswitch overhead on the collection ) .... The only way threading would help here would be if the service is located over the internet, you are not using the whole bandwidth , the web service has plenty of CPU available and has a very high latency (use ping).
Also 300,000 records often will take hundreds of Megs or so - especially with the Dataset Xml overhead. You could get some benefits form threading by storing the Dararows in a server or separate files and have 1 thread feed a queue and sleep and another thread send rows to the service in the queue. Ben > -----Original Message----- > From: Unmoderated discussion of advanced .NET topics. [mailto:ADVANCED- > [EMAIL PROTECTED] On Behalf Of Paul Johansen > Sent: Thursday, 22 April 2004 6:21 AM > To: [EMAIL PROTECTED] > Subject: [ADVANCED-DOTNET] Multiple Threads or ThreadPool? > > I need to process (take the data from each row and use it to call a > relatively slow Web service) a DataRowCollection of about 300,000 > records and would like to divide it up and multithread the processing. > > > > My initial thought was to spawn x number of threads and have them each > process a portion of the rows. I have not used the ThreadPool before, > but would adding each row to the pool with QueueUserWorkItem be a better > solution? > > > > Thanks in advance, > > > > Paul > > > =================================== > This list is hosted by DevelopMentor. http://www.develop.com > Some .NET courses you may be interested in: > > NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles > http://www.develop.com/courses/gaspdotnetls > > View archives and manage your subscription(s) at > http://discuss.develop.com =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com
