Provide more than one processor with a set of tasks

I use a set of tasks to assign a 4-7 core CPU for a java process that typically uses a CPU of ~ 200-400%. The kernel 4-7 was isolated at boot, so only the java process should be run on them.

In the end, the set of tasks seems to block the generated java process in one of the four cores, rather than assigning it to all the cores.

The command I use in my script looks like this:

taskset -c 4,5,6,7 java [...] -jar [...]

Usage taskset -c 4,5,6,7 stress -c 4behaves the same and uses only one core.

How can I assign all four cores to a java process?

+4
source share
1 answer

: -a, , (taskset -h)

" () pid

, taskset -cpa 4-7 'pgrep -n java'

(" ` !)

pgrep PID Java-.

, -, .

+3

All Articles