George George

George George

  • NA
  • 778
  • 0

thread safety in Windows Service design

Apr 14 2008 8:29 AM

Hello everyone,


For Windows Service, for example class Service1 is the main class of my service application, which derives from ServiceBase. I am wondering whether it is possible that two concurrent access to the following 3 cases?

1. the constructor of Service1;
2. OnStart method of Service1;
3. OnStop method of Service.

If yes, I need some synchronizaton control in them. If yes, in what situation the three methods will be called concurrently? We are able to start/stop the same service with different instances (processes) at the same time?


thanks in advance,
George


Answers (3)