Suzi167
February 4th, 2009, 02:26 PM
Hello All gurus,
I have a multithreading question.
I am writing a service which basically is going to be a listener which monitors a folder and when files are dropped in it...etc,etc..... in other words it will be running constantly until I stop the service.
I have the following code:
protected override void OnStart(string[] args)
{
ThreadStart ControllerJob = new ThreadStart(_serviceController.StartProcessing);
Thread thread = new Thread(ControllerJob);
thread.Start();
}
The service registers fine and starts running but the folder monitoring is not quite working.
I have a suspicion that it is because of the way I have the multithreading implemented because when I put
a debug log message after the thread.Start() call I never get the message - and if that is really on a separate thread then I should - right?
Can u by looking at my code tell me what is wrong with the way I have it?
THanks very much in advance.
SUsan
I have a multithreading question.
I am writing a service which basically is going to be a listener which monitors a folder and when files are dropped in it...etc,etc..... in other words it will be running constantly until I stop the service.
I have the following code:
protected override void OnStart(string[] args)
{
ThreadStart ControllerJob = new ThreadStart(_serviceController.StartProcessing);
Thread thread = new Thread(ControllerJob);
thread.Start();
}
The service registers fine and starts running but the folder monitoring is not quite working.
I have a suspicion that it is because of the way I have the multithreading implemented because when I put
a debug log message after the thread.Start() call I never get the message - and if that is really on a separate thread then I should - right?
Can u by looking at my code tell me what is wrong with the way I have it?
THanks very much in advance.
SUsan