LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 08-09-2011, 09:42 AM   #1
DavidA
LQ Newbie
 
Registered: Aug 2011
Location: UK
Posts: 11

Rep: Reputation: Disabled
Can processes/threads move between cores?


Hi

I would like to ask a question regarding processes and threads. I understand the basics of processes and threads running on a single core. I would like to ask whether Linux supports the idea of migrating processes or threads between processors or cores?

The application I have in mind is for power saving. Suppose that a multi-processor computer may run few or many processes. When running few processes, it is required that all processes be migrated to a single processor and the other processors switched to a low power state. Is this supported in Linux?

Best regards

David
 
Old 08-09-2011, 09:49 AM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
http://en.wikipedia.org/wiki/Processor_affinity

If you don't know that processes/threads can move between multiple cores, I don't think you're ready to write a scheduler based upon your assumption that a single busy core would use less power.
 
Old 08-09-2011, 10:09 AM   #3
DavidA
LQ Newbie
 
Registered: Aug 2011
Location: UK
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks for the link. I am new to this concept and am trying to find relevant information.

Please note that I wrote 'migrated to a single processor' not core. Then I think power saving can be expected.

Last edited by DavidA; 08-09-2011 at 10:13 AM.
 
Old 08-09-2011, 10:40 AM   #4
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Right you are.

http://www.lesswatts.org/tips/cpu.php
Quote:
On platforms with multi-core and/or multi-threaded capable processors, the process scheduler in the Linux kernel (starting from version 2.6.18) provides a couple of tunables for power-savings. In the presence of lightly loaded scenarios (where the number of running tasks is less than the number of available logical CPUs in the system), these tunables will minimize the number of processor packages and CPU cores carrying the process load. This allows the other idle processor packages and idle cores in the system to go to the deepest idle state, saving power.
Reading on, it seems whether Linux can already do what you want will depend on your definition of few vs the core count of a single CPU.

Last edited by Proud; 08-09-2011 at 10:42 AM.
 
1 members found this post helpful.
Old 08-09-2011, 11:10 AM   #5
DavidA
LQ Newbie
 
Registered: Aug 2011
Location: UK
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks for the link.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SMP kernel not seeing multiple cores/threads for Intel Core i7 870 processor honnefinger Linux - Kernel 10 04-19-2011 12:55 AM
thread scheduling. is it guaranteed that kernel will run threads on all cores? anilp Linux - Kernel 1 01-26-2011 03:30 PM
Cases where processes will be used and where threads will be used aravinda78 Linux - Software 1 11-28-2008 11:31 AM
When to use threads and processes sr_sanjeev Linux - General 1 04-29-2008 03:38 AM
Show processes, not threads Martin Strand Linux - Newbie 1 06-14-2005 09:46 AM


All times are GMT -5. The time now is 01:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration