Windows Service
-
Hi, I am writing an application for Windows Service, I want to run this Service for every 1 minutes, the Windows Service does call some database objects and performs operations, this is fine up to here. But my question is what if the first cycle of Windows Service didn't complete its operations and if second cycle starts, doesn't this interference can cause Service to fail. Similar type of question I have for the Windows Scheduler too, what if the first cycle of Windows Schedule hasn't completed yet and as per timing if 2nd Scheduler cycle tries to run the same application, isn't it going to interfere and created Problems. Any help a code snippet, a link or a suggestion is going to help me a lot, thanks in advance.
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
Why do you bother? In the time it took you to write up this post, you could have typed the same thing in Google; using fewer words. Do you have a problem with Google or search engines in general? Are you a bot? An unintelligent agent?
"(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal
-
Hi, I am writing an application for Windows Service, I want to run this Service for every 1 minutes, the Windows Service does call some database objects and performs operations, this is fine up to here. But my question is what if the first cycle of Windows Service didn't complete its operations and if second cycle starts, doesn't this interference can cause Service to fail. Similar type of question I have for the Windows Scheduler too, what if the first cycle of Windows Schedule hasn't completed yet and as per timing if 2nd Scheduler cycle tries to run the same application, isn't it going to interfere and created Problems. Any help a code snippet, a link or a suggestion is going to help me a lot, thanks in advance.
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
-
Hi, I am writing an application for Windows Service, I want to run this Service for every 1 minutes, the Windows Service does call some database objects and performs operations, this is fine up to here. But my question is what if the first cycle of Windows Service didn't complete its operations and if second cycle starts, doesn't this interference can cause Service to fail. Similar type of question I have for the Windows Scheduler too, what if the first cycle of Windows Schedule hasn't completed yet and as per timing if 2nd Scheduler cycle tries to run the same application, isn't it going to interfere and created Problems. Any help a code snippet, a link or a suggestion is going to help me a lot, thanks in advance.
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
The Windows task scheduler has an option to not start a new instance if the task is already running.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Hi, I am writing an application for Windows Service, I want to run this Service for every 1 minutes, the Windows Service does call some database objects and performs operations, this is fine up to here. But my question is what if the first cycle of Windows Service didn't complete its operations and if second cycle starts, doesn't this interference can cause Service to fail. Similar type of question I have for the Windows Scheduler too, what if the first cycle of Windows Schedule hasn't completed yet and as per timing if 2nd Scheduler cycle tries to run the same application, isn't it going to interfere and created Problems. Any help a code snippet, a link or a suggestion is going to help me a lot, thanks in advance.
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
That could be answered in a few minutes by testing it. Create a task that writes somewhere for one minute. Start them from your service or the Task-scheduler, with an interval of 10 seconds. So, unless you do something that locks (writing to files and the like) it should not fail.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
The Windows task scheduler has an option to not start a new instance if the task is already running.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Why not just code the service to do its own timing internally? That way you can prevent a new cycle from starting if a previous one has not completed.
-
That could be answered in a few minutes by testing it. Create a task that writes somewhere for one minute. Start them from your service or the Task-scheduler, with an interval of 10 seconds. So, unless you do something that locks (writing to files and the like) it should not fail.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
The Windows task scheduler has an option to not start a new instance if the task is already running.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Hi Richard, Can you please give me the name of the option if you don't mind?
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
It's at the bottom of the "settings" page: Screen-shot[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Hi, I am writing an application for Windows Service, I want to run this Service for every 1 minutes, the Windows Service does call some database objects and performs operations, this is fine up to here. But my question is what if the first cycle of Windows Service didn't complete its operations and if second cycle starts, doesn't this interference can cause Service to fail. Similar type of question I have for the Windows Scheduler too, what if the first cycle of Windows Schedule hasn't completed yet and as per timing if 2nd Scheduler cycle tries to run the same application, isn't it going to interfere and created Problems. Any help a code snippet, a link or a suggestion is going to help me a lot, thanks in advance.
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
If you can add the request to in-memory .net queue it should solve your problem. Keep a thread which will monitor and trigger job from the queue. This way you can decide on a number of threads which can run parallelly (one or multiple).
Ashwin Shetty