• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

Set my thread's importance...

I am looking to set my console applications thread to be of highest priority. How can I do this in C++?
0
strickdd
Asked:
strickdd
  • 3
  • 2
2 Solutions
 
e_tadeuCommented:
Use SetThreadPriority from the Windows API

http://windowssdk.msdn.microsoft.com/en-us/library/ms686277.aspx
0
 
rajeev_devinCommented:
If you using vc++ then do this

SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
0
 
strickddAuthor Commented:
Which priority is higher?  THREAD_PRIORITY_TIME_CRITICAL or THREAD_PRIORITY_HIGHEST?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
strickddAuthor Commented:
Nevermind, i ran some time tests and over all, THREAD_PRIORITY_TIME_CRITICAL, is a higher priority.
0
 
e_tadeuCommented:
Take care setting a priority too high, because you can "lock" your entire system, even the mouse events on other applications (including explorer.exe) ;)
0
 
strickddAuthor Commented:
yeah, i found that out:) I locked up my computer for a few seconds:)
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now