473,387 Members | 1,463 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,387 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 1420
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.