multithreading - Setting a thread priority in a service has no effect -


is there additional configuration needed before can set thread priorities in windows service?

in service, have few threads each call createprocess() function launch external application. adjust thread (or process) priorities normal or lower, depending on other factors.

the problem setthreadpriority() function fails error 6 (invalid handle?). i'm passing in handle obtained process_information::hthread (after calling createprocess() of course), think handle should valid.

i've tried setting priority on processes using setpriorityclass() function, fails.

the service logged on local user.

maybe don't have correct access rights? msdn on setthreadpriority says:

hthread [in] handle thread priority value set.

the handle must have thread_set_information or thread_set_limited_information access right. more information, see thread security , access rights.

windows server 2003 , windows xp/2000: handle must have thread_set_information access right.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -