LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-12-2006, 12:12 PM   #1
ak_47_boy
LQ Newbie
 
Registered: Jan 2006
Posts: 8

Rep: Reputation: 0
Linux MultiThreading ???? Realy ????


Is it true linux will enable a program that is not multithreded to use multiple prosessors?
 
Old 01-12-2006, 01:11 PM   #2
angustia
Member
 
Registered: Apr 2003
Location: chile
Posts: 58

Rep: Reputation: 15
a program that has only one thread will be executed by one processor at time, but not tied to a specific one...
 
Old 01-12-2006, 01:43 PM   #3
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
As angustia said, it could use multiple processors at different times, but never at the same time. What typically happens is your process gets context switched out of execution (because it is waiting on a "long" system call or it ran out of quanta) and when it gets selected for execution again it happens to be on a different physical CPU.

The kernel makes no attempt to introduce parallelism to a non parallel process. This would be quite difficult to accomplish.
 
Old 01-12-2006, 02:45 PM   #4
ak_47_boy
LQ Newbie
 
Registered: Jan 2006
Posts: 8

Original Poster
Rep: Reputation: 0
So the program wont run any faster with 4 prosessors than it would with 1 ?
 
Old 01-12-2006, 03:08 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
An individual application will not benefit from multiple processors unless it was designed to.

On the other hand, a computer system running many process and applications, can definitely benefit. How much depends on the combination of thing running. One thing I do frequently is create a big print queue which chugs away for over an hour while I go surfing. I am sure that this scenario would be more responsive with dual processors.
 
Old 01-12-2006, 03:48 PM   #6
ak_47_boy
LQ Newbie
 
Registered: Jan 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Is there any programs out there ether for windows or linux that will enable a single threaded program to take advantantage of a multiprosessor machien? Emulation? Virtual Prosessor?
 
Old 01-12-2006, 05:02 PM   #7
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Quote:
Originally Posted by ak_47_boy
Is there any programs out there ether for windows or linux that will enable a single threaded program to take advantantage of a multiprosessor machien? Emulation? Virtual Prosessor?
No, it would be extremely difficult to take a single threaded program and automatically make it into something that would benefit from parallel processing. It would take a ridiculous amount of source code analyzing before the program was run to made any significant increase in speed.

However, the more CPU's you have the better a chance your program will get execution time.
 
Old 01-12-2006, 06:59 PM   #8
Hammett
Senior Member
 
Registered: Aug 2003
Location: Barcelona, Catalunya
Distribution: Gentoo
Posts: 1,074

Rep: Reputation: 59
IMHO we will have to wait until programmers code thinking in multi-processor machines. Until then, we won't take that much advantatge of multi-cored CPUs.
 
Old 01-12-2006, 07:16 PM   #9
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
One non-threaded application might not see a performance increase, but multi-core systems can run threaded processes faster (things like oracle, apache, parallel compiles, ect.) and can run two single threaded processors at the same time. There absolutely is an overall increase in system performance with multiple cores.
 
  


Reply



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
Multithreading jayashrik Programming 1 07-20-2005 04:13 AM
Realy Realy Need some basics Essay Slackware 7 04-26-2004 04:59 PM
Multithreading is possible in linux ?. Which tool used for this? saira Linux - Distributions 1 03-24-2004 10:30 PM
Multithreading is possible in linux ?. Which tool used for this? saira Linux - Software 1 03-24-2004 10:29 PM
How OpenMozix is used for multithreading in cluster computing in linux sabeen Red Hat 1 03-24-2004 10:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:19 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