|
-
Oct 13th, 2010, 12:44 AM
#18
Thread Starter
PowerPoster
Re: ThreadPool and large processing of WorkItem
Thanks kindly. yes you are correct about the WaitAll() suggestion, WaitOne is better in this case.
But in regards to LINQ to SQL Query in the ProcessWorkItem (It is using a DataContext using the EF), is there a way to make it threading safe? Currently if I do not do this, it will throw an exception at some point stating that it tried to read data when the connection state is not open (understandably)
I guess I need to keep that synclock (lock in C#) in place around that query?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|