CPU affinity

Can -cpu flag be used to set CPU affinity from the command prompt or a batch file like GPU affinity?

If so would it be possible to set one instance of Touch to 1 CPU (or thread) and then another instance to be able to use the remaining threads for movie decoding?

ie. touch1 -cpu 0
touch2 -cpu [1-7]

For example if you have one project decoding many movies it could start to take aways CPU cycles from another project that is not decoding at all?

thanks
Keith

The OS knows what its doing in this regard, no need to manually assign the process to CPUs. So no there isnt a -cpu option.

It just seemed that heavy movie decoding was interfering with another Touch process. I’ll have to do further tests to verify.

keith

I have been curious on this as-well. I would like to separate CPU threads. Does a separate instance of touch automatically use a different thread?

Yes, another TD process will have it’s entirely own memory space and threads.

My understanding is that this should only use CPU 1.

start /affinity 1 "C:/Program Files/Derivative/TouchDesigner099/bin/TouchDesigner099.exe" "something.toe"

Use cpus 1, 3, and 4:
0001101 → 13 (base 10) → 0xD (hexadecimal)

start /affinity 0xD "C:/Program Files/Derivative/TouchDesigner099/bin/TouchDesigner099.exe" "something.toe" or

start /affinity 13 "C:/Program Files/Derivative/TouchDesigner099/bin/TouchDesigner099.exe" "something.toe"

In both tests, I opened TaskManager, went to details, right clicked on TouchDesigner and then “set affinity”, but all CPUs are checked. Is CPU affinity with this technique not possible? Is there a configuration of computer that would make sense for cpu affinity and touchdesigner usage?

I have never seen a case where it helps. The OS does a much better job at juggling CPU cores than we can.

Thanks. I should have clarified that my situation is 6 simultaneous CPU-heavy touchdesigner projects, but I can imagine that the OS would handle it reasonably.

By the way, task manager confirms that this works.

start /affinity 13 notepad.exe