Multiple Threads Within the IDE

  • Thread starter Thread starter Doug Thews
  • Start date Start date
Agreed. It's probably better to just use "true" instead of a variable, and
then catch the Interrupted exception (if you want a thread that runs
continuously and only quits when the app quits - as I was suggesting):

try
{
while( true )
{
// perform whatever
}
}
catch (ThreadInterruptedException)
{
// Perform cleanup - then return
return;
}


--
Doug Thews
Director, Customer Solutions
D&D Consulting Services
----------------
Visit my Tech Blog at:
http://www.ddconsult.com/blogs/illuminati/
 
Doug Thews said:
Agreed. It's probably better to just use "true" instead of a variable, and
then catch the Interrupted exception (if you want a thread that runs
continuously and only quits when the app quits - as I was suggesting):

try
{
while( true )
{
// perform whatever
}
}
catch (ThreadInterruptedException)
{
// Perform cleanup - then return
return;
}

No, I don't agree with that. It means that you don't really know where
you were when you were interrupted. I prefer to still use an orderly
stopping procedure, but do it in a thread-safe way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top