You can re-use threads... but you can't re-use ThreadStart... very simple example below. I personally don't think doing stuff in a "while loop" is bad - it all depends on what you are trying to do, and without seeing an example of your code it's all just a guess... anyway, I beg forgiveness for this cheesy example but maybe it will illustrate what I mean:
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
namespace TestMultiThread
{
public class Program
{
static Thread threadOne;
static Thread threadTwo;
static Thread threadThree;
static bool threadOneWorking = false;
static bool threadTwoWorking = false;
static bool threadThreeWorking = false;
public static void Main()
{
while (1 == 1)
{
if (!threadOneWorking)
{
threadOneWorking = true;
threadOne = new Thread(new ThreadStart(DoThreadOneWork));
threadOne.Start();
}
if (!threadTwoWorking)
{
threadTwoWorking = true;
threadTwo = new Thread(new ThreadStart(DoThreadTwoWork));
threadTwo.Start();
}
if (!threadThreeWorking)
{
threadThreeWorking = true;
threadThree = new Thread(new ThreadStart(DoThreadThreeWork));
threadThree.Start();
}
Thread.Sleep(100);
}
}
private static void DoThreadOneWork()
{
for (int i = 0; i < 10000; i++) ; // some arbitrary threadOne "work"...
// set this thread's working flag to false on exit...
threadOneWorking = false;
}
private static void DoThreadTwoWork()
{
for (int i = 0; i < 20000; i++) ; // some arbitrary threadTwo "work"...
// set this thread's working flag to false on exit...
threadTwoWorking = false;
}
private static void DoThreadThreeWork()
{
for (int i = 0; i < 30000; i++) ; // some arbitrary threadThree "work"...
// set this thread's working flag to false on exit...
threadThreeWorking = false;
}
}
}