Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Threading
Hi,
 
I have a windows app that I have been running in c# Express 2008 for a year and have been trying to convert it over the last few days to 2010. The problem I am having is it is a multi-threaded application that has to run a series of code every second. What it does is have a main thread, that calls 3 worker threads, waits for them to finish then does some additional processing, sleeps till 1 second and runs again.
 
The problem is part of the code can call a web service that takes 8 seconds to respond, so this bit of code gets called using ThreadPool.QueueUserWorkItem. The problem is when running in 2010 when this part of the code gets called the main thread continues to run but when it awakens the sub threads it hangs until the Threadpool method finishes running.
 
This never happens in 2008. Any suggestions? So far I put that bit of code in it's own thread rather than using Threadpool but same issue.
Posted 20-Aug-10 8:49am
Comments
Christian Graus at 20-Aug-10 16:02pm
   
Sounds like a bug in 2010. You can report bugs to Microsoft. In my experience, they do nothing about it, but you can do it, all the same.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I think it has something to do with the .net framework 4. If i were you, i will have to check again that the functions you are using are thread-safe, not synchronized and no locks are used to block the execution. Start commenting some code lines to help you identify the problem.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 565
1 Maciej Los 359
2 Kornfeld Eliyahu Peter 309
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,303
1 DamithSL 4,764
2 Maciej Los 4,306
3 Kornfeld Eliyahu Peter 3,914
4 Sergey Alexandrovich Kryukov 3,538


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 20 Aug 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100