Link to home
Start Free TrialLog in
Avatar of DavidBirch2dotCom
DavidBirch2dotCom

asked on

Higher program importance

Hi

    I've built myself an ACE little music player, which works brilliantly except when my computer gets busy (for example opening Delphi) when it pauses or stops playing? Is there any way around this? Can I set my program to have higher importance? So it wont get interrupted by heavy CPU usage?

Thanks in advance

David Birch
ASKER CERTIFIED SOLUTION
Avatar of mokule
mokule
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DavidBirch2dotCom
DavidBirch2dotCom

ASKER

thanks mokule

when should i call that?

which would you suggest for a music player?

what is realtime?

David

When?
Before start playing

You must try what give You best results. Though REALTIME_PRIORITY_CLASS rather not.


REALTIME_PRIORITY_CLASS

Process that has the highest possible priority. The threads of the process preempt the threads of all other processes, including operating system processes performing important tasks. For example, a real-time process that executes for more than a very brief interval can cause disk caches not to flush or cause the mouse to be unresponsive

More read there

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/setpriorityclass.asp
ok i wondered if i might need to call it in the project source part. Realtime sounds very dangerous so i will go with ,HIGH_PRIORITY which works great!

thanks

Mokule
 The values are :

  1) REALTIME_PRIORITY_CLASS
  2) HIGH_PRIORITY_CLASS
  3) ABOVE_NORMAL_PRIORITY_CLASS
  4) NORMAL_PRIORITY_CLASS
  5) BELOW_NORMAL_PRIORITY_CLASS
  6) IDLE_PRIORITY_CLASS


  You can see in Winamp options that there is option for REAL TIME PRIORITY, but :
     1) It is not recommended
     2) Don't help

  The problem is in the way Windows manages the drives. It you read/write to HDD, CD Winmdmt.exe process takes very high CPU time.

   I don't agree with module that real time priority is good. It will cause you system to stuck for few moments. In my opinion the system processes are more important that yours, so you should let it function normally.

   Quote mokule :
   "For example, a real-time process that executes for more than a very brief interval can cause disk caches not to flush or cause the mouse to be unresponsive"...

   It can slow your mouse and disk activity - not good idea....

Hi Ivanov

I've never said that real-time will be good.

You can find also this my quote :)
"You must try what give You best results. Though REALTIME_PRIORITY_CLASS rather not."