Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using Ubuntu Server Edition 11.10 and I have two extremely CPU intensive programs running on the same core. Neither of these processes were programmed for multi-core processing. Is there a way I can tell process A to run on Core 1 and process B to run on Core 2?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

The accepted answer may be good advice, but it certainly isn't an answer to your question. Your question doesn't indicate to me that you aren't qualified to hear the answer either, in fact it sounds like a good example of a situation in which you'd want to specifically indicate which processors should do what.

Getting to the point, what you want are CPU Sets. They are supported in 11.10 of Ubuntu, since it uses a recent enough Linux Kernel. I believe Linux 2.6 is required.

You can read the man page for cpuset here: http://www.kernel.org/doc/man-pages/online/pages/man7/cpuset.7.html

Here is another page for general reading: http://www.bullopensource.org/cpuset/

Linux may be "great" at deciding how to allocate CPU time, but it isn't perfect.

share|improve this answer
    
Touché good sir, this is what I was looking for. –  Otoris Mar 24 '12 at 5:22
    
Good answer. I strongly doubt you'll be able to improve performance in a two-core system, but links and references are definitely good. –  Jo-Erlend Schinstad Mar 24 '12 at 11:09
    
The taskset command might be easier for what Otoris is trying to do. Duplicate question: askubuntu.com/questions/102258/… –  Ramón Mar 27 '12 at 19:39

I hope this doesn't come across as rude, but if you ask this question, you shouldn't even consider it. This is one of those things that Linux is seriously good at figuring out all by itself. If you did this, it'd likely have a very negative impact on performance. Even if the program isn't designed for make use of more processors, Linux will move them to different cores as needed. The program won't notice.

You might want to give them both low nice values with the nice command to give them higher priorities.

share|improve this answer
    
:) Thanks, I was unaware of the extent of Linux's genius and was planning for worst case scenario. –  Otoris Mar 23 '12 at 23:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.