How can I run a process on a particular processor in multiprocessor  UNIX machine ?

Arnabtech
Arnabtech used Ask the Experts™
on
I want to run two different high CPU consuming process in two different processor. I have dual core unix machine.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
You can not. OS select CPU for execution in current time interval (dependent on OS, Kernel, ...).
If you simply want to test and view CPU usage you have to start your processes and use "top"(Linux), "prstat"(Solaris) in console or system monitor in gui. Also Memory and IO usages can be interesting.

Commented:
kryadov, you can.
And the reason is: for high CPU usage, CPU switching have a great cost, so one can prefer to use same CPU instead of having additional context switches at rescheduling.
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Top Expert 2015

Commented:
uname -a ???
it is possible, but depends on system.
normally systems are lazy to move processes and only move process to another CPU when one CPU becomes heavily loaded.
In AIX.. you can use bindprocessor  command or subroutine
Top Expert 2015

Commented:
in AIX you have to use bindprocessor in a script, because there is no API to handle CPU binding and it moves I/O intensive processes to lower HMT virtual processor which hurts database network listeners (like TNS)
In AIX.. there is an API... bindprocessor which can bind threads or process... There is bindprocessor command too.
I HPUX, the setproc() system all will bind a process to a processor (though it won't stop other processes using it).

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial