?
Solved

Higher program importance

Posted on 2004-04-16
6
Medium Priority
?
275 Views
Last Modified: 2010-04-05
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
0
Comment
Question by:DavidBirch2dotCom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 300 total points
ID: 10841248
Hi,
try this

SetPriorityClass( GetCurrentProcess,ABOVE_NORMAL_PRIORITY_CLASS);
or
SetPriorityClass( GetCurrentProcess,HIGH_PRIORITY_CLASS);
or
SetPriorityClass( GetCurrentProcess,REALTIME_PRIORITY_CLASS);
0
 
LVL 7

Author Comment

by:DavidBirch2dotCom
ID: 10841266
thanks mokule

when should i call that?

which would you suggest for a music player?

what is realtime?

David

0
 
LVL 17

Expert Comment

by:mokule
ID: 10841310
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
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 7

Author Comment

by:DavidBirch2dotCom
ID: 10841333
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
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 10841347
 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....

0
 
LVL 17

Expert Comment

by:mokule
ID: 10841392
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."
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question