In the past few weeks, to speed up our database freshening process, I’ve created a couple of extra programs, basically copies of the exe file. The program itself, accesses web pages, images etc and uses threads to do so. The second program uses LIMIT 300,100 and the third LIMIT 600,100, to make sure they don’t work on the same records.
Before the last few weeks, one occurrence of the program used to run without problem, from the task scheduler all through the day. Only one occurrence of each exe can run at a time.
Since theres now three programs running, .net 2.0, on xp, the program often seems to get stuck and never ends. I have to kill it from task manager.
It runs fine in the IDE
I just wonder if there would be any benefit from upgrading to vb.net 2010 ?
You’ve got a deadlock problem, so common in threaded code. VS2010 isn’t magically going to make it disappear. There’s a new class in .NET 4.0 called Task, it simplifies the job of managing threads. But is just as likely to suffer from deadlock if your original code is already triggering it. You could rewrite the code with tasks and get lucky. That kind of luck is usually short-lived, it will deadlock once a month instead of once an hour. Far worse since it is so much harder to troubleshoot.
Solve the problem first, consider improving it only after that. And the time you’ll spent on chasing this problem is well worth it, you’ll know a lot more about threading when you’re done.