Click here to Skip to main content
16,007,885 members
Home / Discussions / C#
   

C#

 
GeneralRe: WPF RichTextBox Formatted Data Sent to Access Database Pin
Thomas Stockwell13-Feb-08 13:00
professionalThomas Stockwell13-Feb-08 13:00 
Generalthread Pin
248912813-Feb-08 2:58
248912813-Feb-08 2:58 
GeneralRe: thread Pin
Not Active13-Feb-08 3:12
mentorNot Active13-Feb-08 3:12 
GeneralRe: thread Pin
Bekjong13-Feb-08 3:19
Bekjong13-Feb-08 3:19 
GeneralRe: thread Pin
Spacix One13-Feb-08 5:08
Spacix One13-Feb-08 5:08 
GeneralAbnormal thread results Pin
Yoyosch13-Feb-08 2:21
Yoyosch13-Feb-08 2:21 
GeneralRe: Abnormal thread results Pin
Bekjong13-Feb-08 3:01
Bekjong13-Feb-08 3:01 
GeneralRe: Abnormal thread results Pin
CKnig13-Feb-08 3:02
CKnig13-Feb-08 3:02 
Well no it's normal - you abort the thread after all.
The CriticalRegion just tells the CLR that you app will have major problems if you run into an exception in this region!

Here is the explanation from MSDN:

Hosts of the common language runtime (CLR), such as Microsoft SQL Server 2005, can establish different policies for failures in critical and non-critical regions of code. A critical region is one in which the effects of a thread abort or an unhandled exception might not be limited to the current task. By contrast, an abort or failure in a non-critical region of code affects only the task in which the error occurs.

For example, consider a task that attempts to allocate memory while holding a lock. If the memory allocation fails, aborting the current task is not sufficient to ensure stability of the AppDomain, because there can be other tasks in the domain waiting for the same lock. If the current task is terminated, other tasks could be deadlocked.

When a failure occurs in a critical region, the host might decide to unload the entire AppDomain rather than take the risk of continuing execution in a potentially unstable state. To inform the host that your code is entering a critical region, call BeginCriticalRegion. Call EndCriticalRegion when execution returns to a non-critical region of code.

Using this method in code that runs under SQL Server 2005 requires the code to be run at the highest host protection level.


I guess you want a way to make this code run no matter if a abort is called rigth? - Well you can't sorry (you can handle the ThreadAbortedException but only to die gracefully)
GeneralRe: Abnormal thread results [modified] Pin
Yoyosch13-Feb-08 3:16
Yoyosch13-Feb-08 3:16 
GeneralThreadding Issue Pin
Harvey Saayman13-Feb-08 1:40
Harvey Saayman13-Feb-08 1:40 
GeneralRe: Threadding Issue Pin
Giorgi Dalakishvili13-Feb-08 1:47
mentorGiorgi Dalakishvili13-Feb-08 1:47 
GeneralRe: Threadding Issue Pin
Harvey Saayman13-Feb-08 2:10
Harvey Saayman13-Feb-08 2:10 
GeneralRe: Threadding Issue Pin
Giorgi Dalakishvili13-Feb-08 2:20
mentorGiorgi Dalakishvili13-Feb-08 2:20 
GeneralRe: Threadding Issue Pin
Bekjong13-Feb-08 2:56
Bekjong13-Feb-08 2:56 
GeneralRe: Threadding Issue Pin
Harvey Saayman13-Feb-08 3:16
Harvey Saayman13-Feb-08 3:16 
GeneralRe: Threadding Issue Pin
Bekjong13-Feb-08 3:27
Bekjong13-Feb-08 3:27 
GeneralRe: Threadding Issue Pin
Harvey Saayman13-Feb-08 3:31
Harvey Saayman13-Feb-08 3:31 
GeneralRe: Threadding Issue Pin
Bekjong13-Feb-08 3:46
Bekjong13-Feb-08 3:46 
GeneralRe: Threadding Issue Pin
GuyThiebaut13-Feb-08 4:09
professionalGuyThiebaut13-Feb-08 4:09 
GeneralSoap Serialization vs Binary vs XML Pin
asdf98913-Feb-08 1:00
asdf98913-Feb-08 1:00 
GeneralRe: Soap Serialization vs Binary vs XML Pin
CKnig13-Feb-08 2:24
CKnig13-Feb-08 2:24 
Generalquick tcp question Pin
pokabot13-Feb-08 0:50
pokabot13-Feb-08 0:50 
GeneralRe: quick tcp question Pin
stancrm13-Feb-08 1:57
stancrm13-Feb-08 1:57 
GeneralRe: quick tcp question Pin
pokabot13-Feb-08 9:20
pokabot13-Feb-08 9:20 
GeneralRe: quick tcp question [modified] Pin
engsrini13-Feb-08 15:51
engsrini13-Feb-08 15:51 

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.