Solved

Set execution priority of AX control?

Posted on 2006-11-12
2
242 Views
Last Modified: 2010-04-05
Hi Experts,

I have AX control, which controls a digital camera and saves images as JPEG (1 image per second). This JPEG compression loads my CPU significantly and occasionally hangs more important process of CONTINUOUS data acquisition from ADC cards. It would be nice if JPEG compression was performed in a low-priority thread, and won't obstruct more important tasks. AX support said that this AX contol is multithreaded but the source code ids not available for me (proprietary).

Q1:  Is it possible to assign lower priority execution for an AX control in my application? For example if I put AX.SaveAsJPEG(...) inside my own thread (with low priority), is it going to lower execution priority of the actual code inside AX control?
 
Q2:  I can put this AX control in a separate imaging program and assign lower priority for that program, but will it going to lower actual priority of the JPEG compresion thread inside this AX control?  

sincerely,
odissey1  
0
Comment
Question by:odissey1
2 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 200 total points
ID: 17930272

Q1. If the AX control is doing the work in its own thread, then trying to exec the calls in another thread isn't going to buy you anything (plus, it makes it tricky with marshalling the object to another thread to make the call anyways.). Its the thread priority for the AX control that needs to be modified, so unless you can uniquely identify *which* thread that is, then this is not a viable option.

Q2. Yes. A threads BASE priority is determined by (a) the Thread's priority combined with (b) The thread's process priority. You could try one of 2 values for the SetPriorityClass call:

If Win2k and up, I would recommend:

BELOW_NORMAL_PRIORITY_CLASS
$00004000  
Process that has priority above IDLE_PRIORITY_CLASS but below NORMAL_PRIORITY_CLASS. (Windows NT and Windows Me/98/95:  This value is not supported.)

also could try:

IDLE_PRIORITY_CLASS
$00000040
Process whose threads run only when the system is idle. The threads of the process are preempted by the threads of any process running in a higher priority class. An example is a screen saver.

---

Regards,
Russell

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSON on ISAPI REST Server using Delphi 2 229
PDF library for Delphi 2 104
Moving (cutting/pasting) controls in a TTabbedNotebook... 7 27
DBGrid or StringGrid ? 6 68
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now