Click here to Skip to main content
15,890,185 members
Home / Discussions / C#
   

C#

 
AnswerRe: Open Button Click Event Pin
nelsonpaixao5-Nov-08 14:07
nelsonpaixao5-Nov-08 14:07 
QuestionHow to programmatically release resources hold by Thread? Pin
Member 23244835-Nov-08 6:09
Member 23244835-Nov-08 6:09 
GeneralRe: How to programmatically release resources hold by Thread? Pin
led mike5-Nov-08 6:16
led mike5-Nov-08 6:16 
GeneralRe: How to programmatically release resources hold by Thread? Pin
Member 23244835-Nov-08 6:31
Member 23244835-Nov-08 6:31 
GeneralRe: How to programmatically release resources hold by Thread? Pin
led mike5-Nov-08 7:04
led mike5-Nov-08 7:04 
AnswerRe: How to programmatically release resources hold by Thread? Pin
Guffa5-Nov-08 6:54
Guffa5-Nov-08 6:54 
GeneralRe: How to programmatically release resources hold by Thread? Pin
Member 23244835-Nov-08 7:08
Member 23244835-Nov-08 7:08 
GeneralRe: How to programmatically release resources hold by Thread? Pin
Nicholas Butler5-Nov-08 9:46
sitebuilderNicholas Butler5-Nov-08 9:46 
It look like Guffa has left the building, so I'll have a go at this one Smile | :)

The only difference that setting IsBackground makes is that the thread cannot keep the process alive when it is being shut down. It is a bit of a kludge at the best of times.

As Guffa and led mike have said, using Abort is bad practice. The truth is, you can't know what the thread is doing when the ThreadAbortException is thrown - it will very likely be executing somewhere in the Framework ( in your case probably in something to do with Remoting ). This code may hold internal locks or other resources that are left abandoned by the exception. Orphaned locks will lead to deadlocks when other threads call into the same code, which I suspect is why your UI is freezing.

Abort exists for the CLR to use when tearing down a process. It should never be called by user code.

Nick

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

GeneralRe: How to programmatically release resources hold by Thread? Pin
Member 23244835-Nov-08 10:29
Member 23244835-Nov-08 10:29 
GeneralRe: How to programmatically release resources hold by Thread? Pin
Nicholas Butler5-Nov-08 10:51
sitebuilderNicholas Butler5-Nov-08 10:51 
GeneralRe: How to programmatically release resources hold by Thread? Pin
Member 23244835-Nov-08 11:07
Member 23244835-Nov-08 11:07 
GeneralRe: How to programmatically release resources hold by Thread? Pin
Nicholas Butler5-Nov-08 11:41
sitebuilderNicholas Butler5-Nov-08 11:41 
GeneralRe: How to programmatically release resources hold by Thread? Pin
Member 23244835-Nov-08 12:10
Member 23244835-Nov-08 12:10 
GeneralRe: How to programmatically release resources hold by Thread? Pin
Nicholas Butler5-Nov-08 23:08
sitebuilderNicholas Butler5-Nov-08 23:08 
GeneralRe: How to programmatically release resources hold by Thread? Pin
N a v a n e e t h5-Nov-08 16:40
N a v a n e e t h5-Nov-08 16:40 
GeneralRe: How to programmatically release resources hold by Thread? Pin
Nicholas Butler5-Nov-08 23:07
sitebuilderNicholas Butler5-Nov-08 23:07 
GeneralRe: How to programmatically release resources hold by Thread? Pin
Member 23244836-Nov-08 6:27
Member 23244836-Nov-08 6:27 
GeneralRe: How to programmatically release resources hold by Thread? Pin
N a v a n e e t h6-Nov-08 16:30
N a v a n e e t h6-Nov-08 16:30 
QuestionActive Document Container applications in C# Pin
Rinu_Raj5-Nov-08 5:43
Rinu_Raj5-Nov-08 5:43 
Questioncopying data Pin
netJP12L5-Nov-08 5:40
netJP12L5-Nov-08 5:40 
AnswerRe: copying data Pin
adgonz5-Nov-08 6:04
adgonz5-Nov-08 6:04 
GeneralRe: copying data Pin
led mike5-Nov-08 6:18
led mike5-Nov-08 6:18 
GeneralRe: copying data Pin
netJP12L5-Nov-08 7:53
netJP12L5-Nov-08 7:53 
GeneralRe: copying data Pin
led mike5-Nov-08 8:10
led mike5-Nov-08 8:10 
GeneralRe: copying data Pin
netJP12L5-Nov-08 9:47
netJP12L5-Nov-08 9:47 

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.