473,400 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

Halting and Debugging thread?

I have three data processing routines which I want to run in threads so that
they don’t clog up the UI. How can I halt execution of thread until prior
thread completes successfully.

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click

'Link tables.
'Spin off a new thread.
t1 = New Thread(New ThreadStart(AddressOf CreateLinks))
t1.IsBackground = True
t1.Start()

Select Case True

Case optRawFigures.Checked
'Spin off a new thread.
t2 = New Thread(New ThreadStart(AddressOf GetFigures))
t2.IsBackground = True
t2.Start()

Case optAverage.Checked
'Spin off a new thread.
t3 = New Thread(New ThreadStart(AddressOf CalculateFigures))
t3.IsBackground = True
t3.Start()

End Select

End Sub

Apparently thread t1 is executed on button click along with one of the
threads from Select Case. This leads to error because tables need to be
linked before any data processing job can be done.

I want t1 to execute and when it is completed successfully it should execute
Select Case.

Also, how can I debug the routine which runs off a thread.

Thanks

Jul 21 '05 #1
3 1421
Job Lot <Jo****@discussions.microsoft.com> wrote:
I have three data processing routines which I want to run in threads so that
they don?t clog up the UI. How can I halt execution of thread until prior
thread completes successfully.


I would suggest that you only have one extra thread, and that does both
the table linking and then whichever of the other options is the one
you want.

As for debugging - you debug just as you would anything else, by
putting breakpoints in, stepping through etc.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
I tried to debug inside a thread using breakpoints, but that doesn't work.

"Jon Skeet [C# MVP]" wrote:
Job Lot <Jo****@discussions.microsoft.com> wrote:
I have three data processing routines which I want to run in threads so that
they don?t clog up the UI. How can I halt execution of thread until prior
thread completes successfully.


I would suggest that you only have one extra thread, and that does both
the table linking and then whichever of the other options is the one
you want.

As for debugging - you debug just as you would anything else, by
putting breakpoints in, stepping through etc.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #3
Job Lot <Jo****@discussions.microsoft.com> wrote:
I tried to debug inside a thread using breakpoints, but that doesn't work.


It should work fine Could you post a short but complete program which
demonstrates the problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

117
by: Peter Olcott | last post by:
www.halting-problem.com
31
by: Peter Olcott | last post by:
The Halting Problem can not be solved within the degree of expressability of a TM. My solution only worked because of its more limited degree of expressability. There is no such thing as a void...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
3
by: Job Lot | last post by:
I have three data processing routines which I want to run in threads so that they don’t clog up the UI. How can I halt execution of thread until prior thread completes successfully. Private...
9
by: John Brown | last post by:
Hi there, Has anyone had any problems debugging a thread in VS 2005. If I put a breakpoint on a worker thread (the only one in the app) and then run the app two things happen: 1) It takes an...
5
by: =?Utf-8?B?dXNmaW5lY2F0cw==?= | last post by:
I'm new to asp.net. I'm trying to follow the tutorial walkthroughs and have got a few done. Now I'm doing the one about validating input, and I've run into some problems. In particular, I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.