Click here to Skip to main content
16,013,747 members
Home / Discussions / C#
   

C#

 
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 
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 
You are using background threads to keep the UI responsive, which is good. But then you are blocking in this method. I suggest you disable exporting in your UI until you know all the data is ready.

You will still have to detect when your background threads have completed and the data is ready to be exported, which is a similar requirement to the code you posted. So you will still have to get the threads to signal they have completed. Setting an int counter to the number of threads and having them decrement it when they complete is as good a solution as any. You will also have to invoke a method on your UI thread when all the threads have completed, which would re-enable your export functionality.

You need to find out why QueryThread.threadCount is not being decremented. The code you posted will not stop background threads from running, so you have another problem somewhere.

One possibility is that you have not declared threadCount as volatile. Does the code work in a Debug build ( without optimizations ) ?

Nick
----------------------------------
Be excellent to each other Smile | :)

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 
AnswerRe: How to set a property in a collection based on the join? Pin
Dan Mos17-Feb-10 20:36
Dan Mos17-Feb-10 20:36 
QuestionSaving Data on a Form Pin
thomas_anderson17-Feb-10 18:00
thomas_anderson17-Feb-10 18:00 
AnswerRe: Saving Data on a Form Pin
AspDotNetDev17-Feb-10 18:33
protectorAspDotNetDev17-Feb-10 18:33 

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.