Menu

#699 Alter Thread Priority

None
unread
nobody
threads (2)
none
1
2017-10-31
2017-10-24
Mark Harsen
No

Add the ability to change the relative prioirty of a thread given the TID. At least for Windows, support the standard priorities of IDLE, BELOW_NORMAL, NORMAL, ABOVE_NORMAL, HIGH, or REALTIME set via any methodology you think best. I presume all threads are at NORMAL when started. Changing the priority would be required by this request. Starting a new thread via REPLY could optionally set the thread's priority which would be optional by this request.

This is a long-standing need and all efforts are appreciated! Thank you, -Mark

Discussion

  • Erich

    Erich - 2017-10-25

    Mark, are you aware of SysSetPriority() ?

     
  • Mark Harsen

    Mark Harsen - 2017-10-31

    Eric, Yes. However, it says that it changes the priority of the current process, not thread. My network management code (written almost exclusively in ooRexx) runs a main process (Thor) that starts a lot of threads under that process using REPLY from my own objects (consoles, openers, jobqueue, et cetera). I have the processes priorities set correctly (Thor runs highest, SSH slaves processes next, et cetera). However, sometimes a worker object (thread) will get a lot of work to do, say merging console logs from a big job with lots of output from a large number of SSH slaves) and this batch work can slow down the console objects (threads) so the telnet and HTTPS users suffer.

    I'd like to be able to raise the relative priority of the interactive threads (console, web, et cetera) to "REALTIME", jobqueue thread to "HIGH", and batch worker objects (threads) to below normal (-1?).

    If I'm misunderstanding, please let me know, but with SysSetPriority, I don't see a way to change the relative priority of a thread - it appears to only be able to alter my process priority and, therefore, all threads under that process. Am I wrong? It happens a lot, you know!

    Thanks, -Mark

     

Anonymous
Anonymous

Add attachments
Cancel