I have written a ROSDK service in Delphi that answers queries. In order to do that, it has to evaluate a colossal dataset which makes it very CPU- and disk-intensive.
I would like to be able to lower the thread priority of this task because it disrupts some very time-critical data acquisition tasks running on the same server. Is that possible?
Starting a worker thread would require me to do a pretty big code change: the way the code is now, any exceptions happening in the remote routine are propagated back to the caller. If I move my code to a separate worker thread that would no longer work.
Can’t I just do a simple SetPriorityClass (hInstance,BELOW_NORMAL_PRIORITY_CLASS) in the DPR, and give all threads a somewhat lower priority that way?