The values my C acquaintance gave me are :-THREAD_PRIORITY_HIGHEST -1 THREAD_PRIORITY_ABOVE_NORMAL null THREAD_PRIORITY_NORMAL -2 THREAD_PRIORITY_BELOW_NORMAL 1 THREAD_PRIORITY_IDLE 2147483647 THREAD_PRIORITY_LOWEST -15
I use the following code :-Description Process priority Thread Priority Realtime 256 15 High 128 2 Above normal 32768 1 Normal 32 0 Below normal 16384 -1 Idle 64 -2 Lowest n/a -15
It returns code 0 (failure) for HIGHEST and NORMAL, 1 (OK) for BELOW, IDLE, LOWEST, but does not in fact set the Thread Priority. In fact it will only set Process Priority, and only when I give it correct values as detailed above. E.g.$returncode=Win32::Process::Open($obj,$pid,0); print "\n $returncode \n"; $returncode=$obj->SetPriorityClass(THREAD_PRIORITY_LOWEST); print "\n $returncode \n";
sets Process Priority to normal as it should. Conclusion : SetPriority does not seem able to set Thread Priority. Or am I missing something ? How do I tell it that it's a Thread Priority I'm trying to change rather than a Process Priority ? Why would the Pod text describe Thread Priority values if the routine won't use them ?$returncode=$obj->SetPriorityClass(32);
In reply to Re^4: how to change process & thread priority on Win32 ?
by rbutcher
in thread how to change process & thread priority on Win32 ?
by rbutcher
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |