Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Update > threading with datareader question

Reply
Thread Tools Display Modes

threading with datareader question

 
 
gl
Guest
Posts: n/a

 
      11-29-2005
I'm setting up a windows service, and it's going to use the smartthreadpool
from the code project (basically an advanced windows threadpool). It's the
first time i'm using it and i'm trying to make sure i don't make any type of
design mistakes right off the bat.

1) Is it okay to do something like this:

foreach (DistDataSet.distlistRow lr in this.DistData.distlist)
{
workItemResults.Add(m_SmartThreadPool.QueueWorkIte m(new
WorkItemCallback(this.Distribute),lr));
}
In other words, send the distribute function a row from the datareader. Will
this cause a problem when the work items are working on different rows of the
datareader?

2)Also, there are different points in thread pools where i reference global
arraylists. With arraylists, is it necessary to lock them if i'm adding or
removing from them? Also, when i'm reading a value from them? Would that be
necessary to lock also?

Thanks for any help.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Message Threading, How Do you shut it off Jakester Windows Vista Mail 1 03-02-2009 12:15 AM
Vista and multi threading Johannes Kantelberg Windows Vista Hardware 0 11-30-2006 09:11 PM
Strict Threading David Collantes Windows Vista Mail 2 07-13-2006 01:59 PM
Hyper-Threading Technology Pavel A. Windows Vista Drivers 3 03-15-2005 12:08 AM
Does WDM can run in multi-threading mode? jack su Windows Vista Drivers 5 06-26-2004 12:17 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59