3
1
I would like to do this so I can accurately speed test my processes, and just to be able to have the illusion of control.
Maybe I want to reserve one processor for special programs. Maybe I want to write my own process optimizer. Who knows. The possibilities are endless in my mind.
Is this possible in any OS? If not why not? If we are allowed to compartmentalize memory, why can't we have such control over processors?
Thanks.
possible duplicate of Setting CPU cores off-limits to all threads not specified (preferably in Windows 7) (although I've still never received a good answer for it...)
– Shinrai – 2012-05-01T21:00:44.397@Shinrai: what did you end up doing? Would autoitv3 have worked for you? – user420667 – 2012-05-01T21:22:59.100
We ended up having to approach it from another direction, honestly, because the Windows requirement for that customer was non-negotiable and we never could figure it out. I can't see how autoitv3 could do it. The problem is that it's trivial to get things to start on the processor you want - the hard part is keeping other things off of them. Modern OSes are very good at figuring out where to put things and they really don't like to let you fool with this - I'm guessing it can be done in Linux variants, but to what extent I don't know. – Shinrai – 2012-05-01T21:33:28.117
@Shinrai I had a look at your previous question, and indeed you can do it with AutoIt (the scripts can also be compiled directly into .EXE files to avoid distributing the AutoIt runtime). Basically, find a program which can list the process' affinity, and modify all of them accordingly. – Breakthrough – 2012-05-01T21:35:13.920
@Breakthrough - But what about new processes that start after that? (I'd add that I don't have any practical concern for this anymore but it is still an interesting intellectual exercise (and that's why I've upvoted this as well)) – Shinrai – 2012-05-01T21:46:00.630
@Shinrai I thought about this, and you could simply have the program run all the time, polling all processes at a given interval (e.g. check all process affinities every 5 seconds). It should be a fairly efficient program, since the task scheduler is always running (and thus, the information of interest is always available in RAM). – Breakthrough – 2012-05-01T22:24:52.550
@Breakthrough - I can see how that would probably work, okay. – Shinrai – 2012-05-01T22:47:05.390
@Breakthrough: these are good ideas. However, I think the ideal case is to disallow new programs from being launched / intercept launching of programs so that before they run their affinity is set. I don't know how to do THAT though. If it's polling, the program may run for x amount of time on multiple processors, which defeats the purpose to some extent. – user420667 – 2012-05-02T21:32:20.643
@user420667 I agree, but when you're dealing with a closed-source operating system, there's not much you can do aside from high-level OS calls, which would imply polling. If you're running Linux, something like grawity's suggestion would be best (and indeed, if you need that level of control, maybe you should be using Linux to begin with...). – Breakthrough – 2012-05-04T00:28:12.580