Solved

Higher program importance

Posted on 2004-04-16
6
271 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 75 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
Industry Leaders: 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!

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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