Solved

Allocate a core for a strictly timed process

Posted on 2010-08-14
7
647 Views
Last Modified: 2013-12-16
I need to set a strictly timed periodic process in Win XP (May be Win7 if XP cant do it). I can have a double or quad core computer. I want to allocate a full core entirely, or almost entirely, to the process, so it will not be disturbed by other threads, or media accesses. How can it be done?
I use Visual Studio for development.
0
Comment
Question by:yahali
  • 4
  • 3
7 Comments
 
LVL 32

Expert Comment

by:phoffric
ID: 33442129
What is the resolution and accuracy of your timed periodic process? You may need a real-time clock if the tick count is not sufficient.

In my limited XP account, I tried to set the priority of firefox to "realtime", but it only went to "high". Maybe in admin, I can bump it up higher.

There is also in the task manager a "set affinity" option. Depending upon your needs, you may be able to allocate one of the cores to just your timed periodic process, and all the other processes are allocated to the other cores.
0
 

Author Comment

by:yahali
ID: 33442852
The "Set Affinity" option only restricts said process from running other cores; it doesnt ban other processes from using the allocated core. Thus setting process affinity will protect other threads from CPU clogging, but will not protect the said process from  sharing its core with other programs.
Thanks
Yahali
0
 
LVL 32

Expert Comment

by:phoffric
ID: 33442866
>> it doesnt ban other processes from using the allocated core.
Then is it possible to set affinity for these other processes to cores other than the allocated core?
0
Want to promote your upcoming event?

Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

 

Author Comment

by:yahali
ID: 33443987
That may be practical if you expect your user to go over the application manager every run. A program can easily set its own affinity (if I remember correctly, "SetAffinityMask") but I dont know if it can control the arbitration of other processes by the operating system.
Thx
Yahali
0
 
LVL 32

Accepted Solution

by:
phoffric earned 500 total points
ID: 33444646
Depending upon your needs w.r.t. resolution and accuracy, you may not be able to achieve your goal in a general purpose computer. You should post your requirements. You may have to add a real-time clock if the tick count is insufficient for your needs.

Usually for very stringent timing requirements the user is on a special purpose embedded system where the developer has more control over all the processes. I got the impression that you need to set up this time critical process in a general purpose PC where the user may run any program at any time (and even download new applications that you may unaware of).

Setting the priority high of this one task will help (at the expense of other processes).

You will also have to figure out how to pin your real-time process in memory so that is not swapped out. (In disk-less embedded systems that is not an issue.)

I haven't dealt with affinity so I just did a search to see what is available for automated affinity settings. Here are two discussions with different recommendations:
     http://w.e-e.com/ylzPgX
     http://w.e-e.com/COlIpk

There were several references to Tom's Hardware, so see if you can get this approach to work. There were mixed reviews:

 "how to set processor affinity automatically"
  http://www.tomshardware.com/forum/179198-28-processor-affinity-automatically

Here's an link to older OS. The problem may be that it refers only to non-OS processes:
http://www.windowsitpro.com/article/tips/jsi-tip-3542-how-can-i-permanently-set-the-processor-affinity-for-an-application-.aspx

If you need further assistance, please hit the Request Attention link and request experts in the Windows OS real-time in XP and 7.
0
 

Author Closing Comment

by:yahali
ID: 33445517
Thanks for the patience
0
 
LVL 32

Expert Comment

by:phoffric
ID: 33445649
I wish you the best of luck :)
0

Featured Post

Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

Question has a verified solution.

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

Suggested Solutions

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

929 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

17 Experts available now in Live!

Get 1:1 Help Now