Click here to Skip to main content
15,886,110 members
Home / Discussions / C#
   

C#

 
QuestionHow to get the row number from the DataTable.Row.Find() method? Pin
joaquimc3-Apr-07 9:52
joaquimc3-Apr-07 9:52 
AnswerRe: How to get the row number from the DataTable.Row.Find() method? Pin
Guffa3-Apr-07 13:27
Guffa3-Apr-07 13:27 
AnswerRe: How to get the row number from the DataTable.Row.Find() method? [modified] Pin
joaquimc5-Apr-07 3:38
joaquimc5-Apr-07 3:38 
QuestionHow can I bind to a database with Dataset Pin
mghiassi3-Apr-07 9:41
mghiassi3-Apr-07 9:41 
AnswerRe: How can I bind to a database with Dataset Pin
kubben3-Apr-07 9:48
kubben3-Apr-07 9:48 
AnswerRe: How can I bind to a database with Dataset Pin
Muammar©3-Apr-07 22:05
Muammar©3-Apr-07 22:05 
GeneralRe: How can I bind to a database with Dataset Pin
mghiassi5-Apr-07 8:30
mghiassi5-Apr-07 8:30 
QuestionStopping threads without Thread.Abort() Pin
JHubSharp3-Apr-07 9:36
JHubSharp3-Apr-07 9:36 
I'm pretty new to multithreaded code. I understand a lot of the concepts (or think I do), but I'm extremely green in applying them.

That being said, I have a webservice that is starting three threads. These threads could finish anywhere from a few minutes to a day depending on how much data is being processed from an external DB. The situation I'm currently experiencing is that if one thread fails, I'd like to stop the other two threads in order to save resources.

Initially I was using Thread.Abort(), but I quickly realized that when catching the ThreadAbortException and aborting the other threads, that would spawn additional exceptions, which would require a new try/catch block, etc. I started googling and saw more...impolite Smile | :) things said about Thread.Abort() and how it's hard to determine when the exception will even be thrown.

So, I'm trying to find a way to stop my threads without using Thread.Abort. I've seen people mention using a flag or Mutex to signal the threads to stop, but naturally that means all my methods need to check for this flag in many places, and I don't see a clean way to do that. Most examples I see will do something like:

(while !stopThread)
{
// do some work
}

which is very convenient of them. How is this relevant when the work is a one-time thing, not something you'd loop through? Is there something I'm missing?

Thanks for any and all help. Cool | :cool:
AnswerRe: Stopping threads without Thread.Abort() Pin
Leslie Sanford3-Apr-07 11:30
Leslie Sanford3-Apr-07 11:30 
QuestionTransparent Label Pin
logicon3-Apr-07 9:27
logicon3-Apr-07 9:27 
AnswerRe: Transparent Label Pin
Douglas Troy3-Apr-07 9:29
Douglas Troy3-Apr-07 9:29 
GeneralRe: Transparent Label Pin
logicon3-Apr-07 9:35
logicon3-Apr-07 9:35 
GeneralRe: Transparent Label Pin
Douglas Troy3-Apr-07 9:38
Douglas Troy3-Apr-07 9:38 
GeneralRe: Transparent Label Pin
logicon3-Apr-07 9:40
logicon3-Apr-07 9:40 
GeneralRe: Transparent Label Pin
Douglas Troy3-Apr-07 9:51
Douglas Troy3-Apr-07 9:51 
GeneralRe: Transparent Label Pin
Dave Kreskowiak3-Apr-07 10:03
mveDave Kreskowiak3-Apr-07 10:03 
QuestionSelf restart Pin
Marc Clifton3-Apr-07 9:05
mvaMarc Clifton3-Apr-07 9:05 
AnswerRe: Self restart Pin
Douglas Troy3-Apr-07 9:22
Douglas Troy3-Apr-07 9:22 
AnswerRe: Self restart Pin
kubben3-Apr-07 9:46
kubben3-Apr-07 9:46 
QuestionControl box doesnt exit application Pin
mfmaneef3-Apr-07 8:51
mfmaneef3-Apr-07 8:51 
QuestionRe: Control box doesnt exit application Pin
Douglas Troy3-Apr-07 8:56
Douglas Troy3-Apr-07 8:56 
AnswerRe: Control box doesnt exit application Pin
mfmaneef3-Apr-07 9:05
mfmaneef3-Apr-07 9:05 
GeneralRe: Control box doesnt exit application Pin
Douglas Troy3-Apr-07 9:27
Douglas Troy3-Apr-07 9:27 
QuestionUsing .NET C# UI control from Visual Studio 6 C++ Pin
StephenJB3-Apr-07 8:17
StephenJB3-Apr-07 8:17 
QuestionSaving project to file Pin
sinosoidal3-Apr-07 7:02
sinosoidal3-Apr-07 7:02 

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.