Solved

Allocate a core for a strictly timed process

Posted on 2010-08-14
7
654 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

726 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