How do processes work with windows services?
I have a widows service that is scheduled to run every hour or so. It basically calls a static method in a referenced assembly.
My concern is that the method wont fin开发者_Python百科ish running during the hour period, so if it is overlapping it will cause some problems, im using lock statement around the method body.
my question is this... will the method called start a new process every hour, and if so, will the lock statement work across processes?
It sounds like you're using the windows scheduler to kick off your task. You might be better off making it a full Windows Service, then you've got a lot more control of when you get invoked.
If you need synchronization across processes, you should use a mutex. I am not sure if your code will launch a new process every hour, need more information about what you are doing.
精彩评论