Click here to Skip to main content
15,899,632 members
Home / Discussions / C#
   

C#

 
QuestionNt Event logger Pin
sharathgowda20-Oct-05 2:32
sharathgowda20-Oct-05 2:32 
AnswerRe: Nt Event logger Pin
S. Senthil Kumar20-Oct-05 4:36
S. Senthil Kumar20-Oct-05 4:36 
QuestionListView DisObeys!!! Pin
Ali Beirami20-Oct-05 2:12
Ali Beirami20-Oct-05 2:12 
QuestionStoping a running thread Pin
reederma20-Oct-05 2:04
reederma20-Oct-05 2:04 
AnswerRe: Stoping a running thread Pin
Tom Larsen20-Oct-05 3:27
Tom Larsen20-Oct-05 3:27 
GeneralRe: Stoping a running thread Pin
reederma20-Oct-05 3:43
reederma20-Oct-05 3:43 
GeneralRe: Stoping a running thread Pin
S. Senthil Kumar20-Oct-05 4:44
S. Senthil Kumar20-Oct-05 4:44 
GeneralRe: Stoping a running thread Pin
Tom Larsen20-Oct-05 8:21
Tom Larsen20-Oct-05 8:21 
Basically yeah what Senthil wrote. Smile | :)

RochesterMark wrote:
1. Throw an exception to the thread. So I catch that exception within the thread.


No. Threads by definition hold their own stack. Any reference, including exceptions, generated in one thread are meaningless in another. Trying to mess with another stack frame is of dubious value no mater what you are trying.

What you are thinking about is a concept like a "signal" or events or other cross threading data ideas (ala. IPC, shared memory segments, etc). I avoided mentioning these things because they are really somewhat advanced.

RochesterMark wrote:
2. Or catch the ThreadAbortException in the thread.


Once again, exception generated in one thread is meaningless in another. Trying to catch an exception that isn't in your stack frame is a weird concept anyway. Throwing an exception modifies the stack of the current context. Catching the exception of another thread is as "crazy" as making another thread call a function in the middle of execution.

It is my experience that most of the time when someone is asking a question that violates fundemental principals of a system, in this case Threading, they need to seriously reevaluate what is going on. Trying to force a thread to actively manipulate the stack of another thread is simply not sane even if the runtime allowed it so why would a software engineer want to write software that does this?
Questioncode Pin
johan198520-Oct-05 1:44
johan198520-Oct-05 1:44 
AnswerRe: code Pin
enjoycrack20-Oct-05 7:08
enjoycrack20-Oct-05 7:08 
AnswerRe: code Pin
Matt Newman20-Oct-05 9:03
Matt Newman20-Oct-05 9:03 
AnswerRe: code Pin
Matt Gerrans20-Oct-05 13:17
Matt Gerrans20-Oct-05 13:17 
GeneralRe: code Pin
tatchung20-Oct-05 15:19
tatchung20-Oct-05 15:19 
QuestionHow to Select Acroos All pages in Grid Pin
kris8220-Oct-05 1:19
kris8220-Oct-05 1:19 
Questioncheck interface Pin
ppp00120-Oct-05 1:07
ppp00120-Oct-05 1:07 
AnswerRe: check interface Pin
Guffa20-Oct-05 1:35
Guffa20-Oct-05 1:35 
Questioncreate a crypt ing key by text Pin
Sasuko20-Oct-05 0:57
Sasuko20-Oct-05 0:57 
GeneralRe: create a crypt ing key by text Pin
Guffa20-Oct-05 1:21
Guffa20-Oct-05 1:21 
GeneralRe: create a crypt ing key by text Pin
Sasuko20-Oct-05 1:42
Sasuko20-Oct-05 1:42 
GeneralRe: create a crypt ing key by text Pin
Guffa20-Oct-05 2:23
Guffa20-Oct-05 2:23 
QuestionVideos show wrong duration Pin
Sensei7620-Oct-05 0:33
Sensei7620-Oct-05 0:33 
AnswerRe: Videos show wrong duration Pin
Pixinger7720-Oct-05 0:49
Pixinger7720-Oct-05 0:49 
QuestionNUMERIC DataGridViewTextBoxColumn Pin
Greeky20-Oct-05 0:27
Greeky20-Oct-05 0:27 
QuestionCheck if users on network Pin
20-Oct-05 0:14
suss20-Oct-05 0:14 
AnswerRe: Check if users on network Pin
Dave Kreskowiak20-Oct-05 3:22
mveDave Kreskowiak20-Oct-05 3:22 

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.