skythinker
New member
- Joined
- Dec 12, 2010
- Messages
- 3
- Programming Experience
- 10+
Hello everyone!
I'm working with vb.net 3.5SP1 /VS2008.
I'm familiar with windows threads from C++ but I didn't do it since the 90s.
I have 5 threadpool calls (ThreadPool.QueueUserWorkItem) that do some complex work (they read info from different web pages, regular expressions, etc) and each updates different columns in a data-grid view. They pause for 1 second between each web read with thread.sleep (not to overload the server).
My issue is that some of the threads do not complete. I get for example 3 results when I should have 8. Sometimes it works fine. This is an older 3.0Ghz HT machine, I want to test it on the lowest common denominator(and that is all I have ). I tried using
, it seems to help but it is hard to tell. I tried using the thread debug window but it is not really helpful, it seems do disappear during execution.
If I remove the threads I always get my data. I'm wondering if something is being blocked? Is there a way to debug this?
Also, does thread.sleep(x) stop all threads or just the thread that the statement is executed in?
I'm working with vb.net 3.5SP1 /VS2008.
I'm familiar with windows threads from C++ but I didn't do it since the 90s.
I have 5 threadpool calls (ThreadPool.QueueUserWorkItem) that do some complex work (they read info from different web pages, regular expressions, etc) and each updates different columns in a data-grid view. They pause for 1 second between each web read with thread.sleep (not to overload the server).
My issue is that some of the threads do not complete. I get for example 3 results when I should have 8. Sometimes it works fine. This is an older 3.0Ghz HT machine, I want to test it on the lowest common denominator(and that is all I have ). I tried using
VB.NET:
Monitor.Enter(ListView1)
If I remove the threads I always get my data. I'm wondering if something is being blocked? Is there a way to debug this?
Also, does thread.sleep(x) stop all threads or just the thread that the statement is executed in?