using System.Threading;
bool _run;
Thread _thread;
public void Start()
{
_run = true;
_thread = new Thread(new ThreadStart(Run));
_thread.IsBackground = true;
_thread.Name = "plugin thread";
_thread.Priority = ThreadPriority.Lowest;
_thread.Start();
}
public void Stop()
{
_run = false;
}
private void Run()
{
while (_run)
{
// your treatment
}
}