Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Allocate a core for a strictly timed process

Posted on 2010-08-14
7
Medium Priority
?
672 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
[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
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

597 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