on 07-28-2014 11:11 AM
Hello, all
I have a background background process (a stored procedure), which is lengthy and sometimes resource consuming.
However, it is nowhere near critical for speed, so if it were a regular windows process, I would have launched it with low priority.
My question is, can I start a process in SQL Anywhere, which would clear itself from CPU if other request come in?
Thank you
Arcady
Hi Arcady,
You can execute
SET TEMPORARY OPTION priority = 'BACKGROUND';
as the first line of the stored procedure. This will mark entire connection as a background priority task (similar to setting a processes priority in Windows).
When the stored procedure is completed, you'll want to make sure you set the priority back to a normal level. If the procedure is triggered in an event, this method will still be effective. When an event is fired it has an internal connection created for it.
Although we do not completely remove the task from the CPU (I imagine this could lead to some deadlocks), we ensure it gets significantly less CPU time then other connections.
Hope this helps,
Mikel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.