Hi All,
Am new to threading concepts.
i want to start a thread with a method DoProcess and run this method periodically at some time interval. for this i implemented like below.
public void startWatcher(bo ol setTimer)
{
TimerCallback timerdelg = new TimerCallback(s tart);
tmr = new Timer(timerdelg , null, 8000, 60000);
}
void start()
{
waitOnThread();
watcherThread = new Thread(new ThreadStart(thi s.CheckOrderSta tus));
watcherThread.I sBackground = true;
watcherThread.N ame = "OrderStatusWat cher";
watcherThread.S tart();
}
but this will create thread for each timer interval.
How to start thread once and run that method continiusly until user stops the thread.?.
Could some body put light on me.
thanks for your time.,
Rgds,
vsr
Am new to threading concepts.
i want to start a thread with a method DoProcess and run this method periodically at some time interval. for this i implemented like below.
public void startWatcher(bo ol setTimer)
{
TimerCallback timerdelg = new TimerCallback(s tart);
tmr = new Timer(timerdelg , null, 8000, 60000);
}
void start()
{
waitOnThread();
watcherThread = new Thread(new ThreadStart(thi s.CheckOrderSta tus));
watcherThread.I sBackground = true;
watcherThread.N ame = "OrderStatusWat cher";
watcherThread.S tart();
}
but this will create thread for each timer interval.
How to start thread once and run that method continiusly until user stops the thread.?.
Could some body put light on me.
thanks for your time.,
Rgds,
vsr
Comment