Click here to Skip to main content
15,897,519 members
Home / Discussions / C#
   

C#

 
AnswerRe: Distorted Controls Pin
OriginalGriff17-Feb-10 23:16
mveOriginalGriff17-Feb-10 23:16 
Question[HELP] Plotting readings on graph dynamically Pin
DanielTKS17-Feb-10 20:51
DanielTKS17-Feb-10 20:51 
AnswerMessage Closed Pin
17-Feb-10 21:17
stancrm17-Feb-10 21:17 
GeneralRe: [HELP] Plotting readings on graph dynamically Pin
DanielTKS17-Feb-10 23:06
DanielTKS17-Feb-10 23:06 
AnswerRe: [HELP] Plotting readings on graph dynamically Pin
OriginalGriff17-Feb-10 23:19
mveOriginalGriff17-Feb-10 23:19 
QuestionDrawing text along an elliptic line in GDI Pin
Berlus17-Feb-10 20:40
Berlus17-Feb-10 20:40 
AnswerRe: Drawing text along an elliptic line in GDI Pin
OriginalGriff18-Feb-10 0:19
mveOriginalGriff18-Feb-10 0:19 
QuestionThreads issue Pin
HideIvy17-Feb-10 20:18
HideIvy17-Feb-10 20:18 
I have one main thread, and many other background thread.
The main usage of those background thread is to query data (quite a number of queries from the web, that's why I make it threads: avoid the lagging of the user interface ).

When it comes to exporting the data in the main thread(the user interface), I need to wait until all the other thread finished.

in my code, I use:

//...code to open save file dialog...

//this loop to wait for all the threads finish their query
//QueryThread.threadCount is the count of the background threads
while (QueryThread.threadCount != 0)
{
    Thread.CurrentThread.Join(1000);
    Console.WriteLine(QueryThread.threadCount);
}

//...code to export data...


if I comment the while loop out, the program run smoothly, but some of my exported data will have possibility of showing some "unwanted" material since some of the background threads hasn't finished their work.

however, the above while loop is infinite, the threadCount never change, which means during the "Join()" method, no background thread is being ran.

why the background threads are not ran and how can i solve this problem?

Thanks a lot!
AnswerRe: Threads issue Pin
Calla17-Feb-10 20:51
Calla17-Feb-10 20:51 
AnswerRe: Threads issue Pin
Mirko198017-Feb-10 21:52
Mirko198017-Feb-10 21:52 
AnswerRe: Threads issue Pin
Nicholas Butler18-Feb-10 0:25
sitebuilderNicholas Butler18-Feb-10 0:25 
QuestionRe: Threads issue Pin
harold aptroot18-Feb-10 0:48
harold aptroot18-Feb-10 0:48 
AnswerRe: Threads issue Pin
David Skelly18-Feb-10 3:03
David Skelly18-Feb-10 3:03 
AnswerRe: Threads issue Pin
HideIvy18-Feb-10 22:28
HideIvy18-Feb-10 22:28 
Questiontreenodecollection nodes not working as expected with created class [SOLVED] Pin
tonyonlinux17-Feb-10 20:07
tonyonlinux17-Feb-10 20:07 
AnswerRe: treenodecollection nodes not working as expected with created class Pin
Dan Mos17-Feb-10 20:28
Dan Mos17-Feb-10 20:28 
GeneralRe: treenodecollection nodes not working as expected with created class [SOLVED] Pin
tonyonlinux18-Feb-10 1:07
tonyonlinux18-Feb-10 1:07 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
tonyonlinux18-Feb-10 1:31
tonyonlinux18-Feb-10 1:31 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
Dan Mos18-Feb-10 2:40
Dan Mos18-Feb-10 2:40 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
tonyonlinux18-Feb-10 6:43
tonyonlinux18-Feb-10 6:43 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
Dan Mos18-Feb-10 10:03
Dan Mos18-Feb-10 10:03 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
tonyonlinux18-Feb-10 13:18
tonyonlinux18-Feb-10 13:18 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
Dan Mos18-Feb-10 13:34
Dan Mos18-Feb-10 13:34 
GeneralRe: treenodecollection nodes not working as expected with created class Pin
tonyonlinux19-Feb-10 17:00
tonyonlinux19-Feb-10 17:00 
QuestionHow to set a property in a collection based on the join? Pin
sri_346417-Feb-10 20:04
sri_346417-Feb-10 20:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.