Click here to Skip to main content
15,893,668 members
Home / Discussions / C#
   

C#

 
AnswerRe: Stopping threads (semi-safely).... Pin
PIEBALDconsult12-Apr-10 9:58
mvePIEBALDconsult12-Apr-10 9:58 
AnswerRe: Stopping threads (semi-safely).... Pin
Dave Kreskowiak12-Apr-10 9:59
mveDave Kreskowiak12-Apr-10 9:59 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 10:16
Jacob Dixon12-Apr-10 10:16 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 10:51
Jacob Dixon12-Apr-10 10:51 
GeneralRe: Stopping threads (semi-safely).... Pin
PIEBALDconsult12-Apr-10 13:02
mvePIEBALDconsult12-Apr-10 13:02 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 13:39
Jacob Dixon12-Apr-10 13:39 
GeneralRe: Stopping threads (semi-safely).... Pin
PIEBALDconsult12-Apr-10 13:51
mvePIEBALDconsult12-Apr-10 13:51 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 13:58
Jacob Dixon12-Apr-10 13:58 
I'm not really sure how to do this without "making the form depend on the threads". I have to use threads to get this information or the GUI will just lock up. Not letting the user close the form because the thread is still working is not feasible.

What you are suggesting is to check if a thread is alive on FormClosing (how else do you know when a user is closing a form), then if it is alive call a Thread.Abort(). I am not sure how threads abort.. so if it is in the middle of the WMI call does it ABORT then or wait until the WMI is finished and then abort?

If I join it with the main thread it will lock up the GUI right?
GeneralRe: Stopping threads (semi-safely).... Pin
PIEBALDconsult12-Apr-10 14:15
mvePIEBALDconsult12-Apr-10 14:15 
GeneralRe: Stopping threads (semi-safely).... Pin
Dave Kreskowiak12-Apr-10 15:33
mveDave Kreskowiak12-Apr-10 15:33 
AnswerRe: Stopping threads (semi-safely).... Pin
William Winner12-Apr-10 10:23
William Winner12-Apr-10 10:23 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 10:27
Jacob Dixon12-Apr-10 10:27 
GeneralRe: Stopping threads (semi-safely).... Pin
Luc Pattyn12-Apr-10 10:55
sitebuilderLuc Pattyn12-Apr-10 10:55 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 11:14
Jacob Dixon12-Apr-10 11:14 
GeneralRe: Stopping threads (semi-safely).... Pin
Luc Pattyn12-Apr-10 11:23
sitebuilderLuc Pattyn12-Apr-10 11:23 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 11:27
Jacob Dixon12-Apr-10 11:27 
GeneralRe: Stopping threads (semi-safely).... Pin
Luc Pattyn12-Apr-10 11:40
sitebuilderLuc Pattyn12-Apr-10 11:40 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 11:23
Jacob Dixon12-Apr-10 11:23 
GeneralRe: Stopping threads (semi-safely).... Pin
William Winner12-Apr-10 11:01
William Winner12-Apr-10 11:01 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 11:07
Jacob Dixon12-Apr-10 11:07 
GeneralRe: Stopping threads (semi-safely).... Pin
William Winner12-Apr-10 12:49
William Winner12-Apr-10 12:49 
GeneralRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 13:40
Jacob Dixon12-Apr-10 13:40 
AnswerRe: Stopping threads (semi-safely).... Pin
Jacob Dixon12-Apr-10 14:38
Jacob Dixon12-Apr-10 14:38 
GeneralRe: Stopping threads (semi-safely).... Pin
DaveyM6912-Apr-10 14:46
professionalDaveyM6912-Apr-10 14:46 
AnswerRe: Stopping threads (semi-safely).... Pin
DaveyM6912-Apr-10 14:44
professionalDaveyM6912-Apr-10 14:44 

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.