LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-21-2007, 11:52 AM   #1
syvy
Member
 
Registered: Sep 2005
Location: Germany
Distribution: slackware64
Posts: 113

Rep: Reputation: 17
2.6.21.5-smp: some programs use both cores some only one. why?


A stupid question about smp:

I wonder why some programs use only one core with 100% load while the second core does nearly nothing.
Sometimes the working core changes but still only one does the main work.
On the other hand there are programs distibuting the load balanced to both cores.
 
Old 12-21-2007, 12:11 PM   #2
FraGGod
Member
 
Registered: Jun 2007
Location: Yekaterinburg, RU
Distribution: gentoo
Posts: 59

Rep: Reputation: 16
If every one processor instruction is dependent on the result of previous one's execution - is there any point of multiple cores executing them?
All I'm trying to say is that not only kernel have to be made for multi-core system but the software too, more or less.
 
Old 12-22-2007, 04:10 AM   #3
syvy
Member
 
Registered: Sep 2005
Location: Germany
Distribution: slackware64
Posts: 113

Original Poster
Rep: Reputation: 17
So the software has to be programmed to execute on multi cores. Is that right?
 
Old 12-22-2007, 04:53 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Well, yes.
 
Old 12-22-2007, 04:56 AM   #5
rg3
Member
 
Registered: Jul 2007
Distribution: Fedora
Posts: 527

Rep: Reputation: Disabled
Yes and no. The program must use several threads or execution flows for it to be able to take advantage of a multiprocessor system. Each processor (or core in this case) executes one thread at a time, changing the executing thread from time to time. If a program only has one thread (this is a very common case), it will be running in one of the processors. If, however, a program uses several threads, they can be run on different processors at the same time. You can have a multithreaded program running on a single processor, though, so it doesn't need to be programmed specifically to take advantage of multiple processors or cores. The OS takes care of that.
 
Old 12-22-2007, 05:18 AM   #6
syvy
Member
 
Registered: Sep 2005
Location: Germany
Distribution: slackware64
Posts: 113

Original Poster
Rep: Reputation: 17
OK, I understand. Thanks for your answers and for being not too scientific ;-)
 
  


Reply

Tags
awesomeness



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
cores vs. clockspeed jhwilliams Linux - Hardware 26 10-21-2007 09:35 AM
Can Linux SMP Kernel Support 3 Cores CPU? btbx Linux - Kernel 1 07-26-2007 03:04 AM
compiling programs on an smp pc to use on non smp pc Carpo Slackware 5 03-22-2007 03:52 PM
Cannot get SMP / dual cores working in Edgy stevenmansour Ubuntu 2 11-18-2006 03:12 PM
Cores on Fedora jonty_11 Fedora 2 11-05-2004 09:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:25 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
Open Source Consulting | Domain Registration