|
-
December 2nd, 2009, 12:57 PM
#1
Simple Threading Question
Dear Gurus,
I am running some lengthy calculations and attempt to provide some feedback from it in the dialog via showing the iteration number, elapsed time, etc, my "calculation" program looks like this:
void CalcProgram()
{
...
Thread MyProgress = new Thread(new ThreadStart(MyUpdate));
// Start the thread
MyProgress.Start();
for(i=0; i<IterationNumber; i++)
{
...// Long calcuations
...
MessageBox.Show("I am here");
}
}
When I run the program and comment out the MessageBox shown, the thread seem to be not working, i.e. it does not provide the expected output. However, when the message box is there, the thread seem to be working as expected only when the box is shown, when I click "OK" on the box it does not provide any updates until the MessageBox is shown again.
Does anybody knows why????
Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|