Solved

Allocate a core for a strictly timed process

Posted on 2010-08-14
7
649 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
On Beyond Tools A conversation I recently had with the DevOps manager of a major online retailer really made me think about DevOps monitoring tools (https://www.onpage.com/devops-incident-management-tool/). The manager and I discussed how sever…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

770 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