You are not logged in.

#1 2009-07-25 23:01:45

deadlylife
Member
Registered: 2008-12-24
Posts: 120

Dedicating a single core to a single app?

Hello, I'm in the process of installing HL2 and would like to know if I can assign HL2 and Wine to a single core (my second) and run everything else on the first?

Offline

#2 2009-07-26 03:40:47

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Dedicating a single core to a single app?

Yes you can... Google for "CPU Affinity" or "Processor Affinity" or something similar. (Sorry, I can't remember how to off the top of my head)

Offline

#3 2009-07-26 06:08:37

doorknob60
Member
Registered: 2008-09-29
Posts: 403

Re: Dedicating a single core to a single app?

taskset -c 1 command

Replace 1 with which core you want, starting at 0, so 1 is infact your second core.

Offline

#4 2009-07-26 06:54:27

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Offline

#5 2009-07-26 07:08:27

B-Con
Member
From: USA
Registered: 2007-12-17
Posts: 554
Website

Re: Dedicating a single core to a single app?

doorknob60 wrote:
taskset -c 1 command

Replace 1 with which core you want, starting at 0, so 1 is infact your second core.

If I understand the man page correctly, taskset only limits the process to that core, but it doesn't *reserve* that core for that process.

I think the OP wants to guarantee that his process has an entire core to itself. Taskset only looks (to me) like it limits the process to the core, but does not limit the core to the process.

If the above is true, would setting the niceness at -20 effectively give the process dominance on the core it's on? Ie:

taskset -c 1 command & pid=$!
renice -20 $pid

Offline

#6 2009-07-26 07:49:44

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Dedicating a single core to a single app?

I do this with Thief 2 in Wine, which is unstable if it runs on more than one core:

taskset -c 1 /usr/bin/wine thief2

Offline

#7 2009-07-26 08:57:12

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Dedicating a single core to a single app?

B-Con wrote:

I think the OP wants to guarantee that his process has an entire core to itself. Taskset only looks (to me) like it limits the process to the core, but does not limit the core to the process.

AFAIK, the only way to do this would be to set all *other* processes to only use 1 core, thereby leaving one core free for the other process.

Offline

Board footer

Powered by FluxBB