Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How related is multi-threaded programming and multi-processor machines?

Posted on 2010-08-18
4
Medium Priority
?
354 Views
Last Modified: 2013-12-17
Is writing a program to be multi-threaded automatically a way to make that program perform optimally on a multi-processor machine?  Or are there other considerations that need to be programmed into multi-threaded applications?

Curious...

newbieweb
0
Comment
Question by:newbieweb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 18

Accepted Solution

by:
Anil Golamari earned 668 total points
ID: 33469019
Multiprocessing : Several jobs can run at the same time.

Multi-threading : Same job can be broken logically and executed simultaneously and the results are combined at the end of processing

http://forums.techarena.in/software-development/1131462.htm
http://www.jguru.com/faq/view.jsp?EID=211169

hope these links help you.
0
 
LVL 16

Assisted Solution

by:Vikram Singh Saini
Vikram Singh Saini earned 668 total points
ID: 33469107
Hi,

To your first question answer is  true.

Let us try to understand the scene behind. For example, your application is multithreaded app. and when it executes different threads for making program optimize ( or in other words it can be say to utilize maximum resources for faster execution of code).

The programs which doesn't use threading are tend to using single processor generally. If the application is multithreaded (as already said), then it will execute threads two or more at a time, causing load on processor, and since processor needs to make threads in queue to handle them one by one.

In that case if there is one more processor then the other threads waiting in queue can be send to the next processor to execute and hence you are using your computer resources to max. Ultimately this will increase performance of your application and yes it makes it optimize too.

Considerations that need to be programmed into multithreaded application:

(1) Your application should have proper managements of Threads.
(2) Sometimes if both thread tries to access single resource or are waiting for each other to complete their operation respectively can cause problem in your program. Or it makes your program non-responsive for long time.
(3) Creating lot of threads in program unnecessary is also not recommended because it will increase load on processor unnecessary decreasing overall performance of system.

Hope it helps u to understand.

Regards,
V.S.Saini


0
 
LVL 5

Assisted Solution

by:TechnicallyMaybe
TechnicallyMaybe earned 664 total points
ID: 33469132
A program has to be coded to take advantage of multiple CPUs.  If not, it will only use 1. A multi-threaded app won't necessarily be multi-cpu.
An example of a multithreaded app is Firefox where each tab runs in it's own thread.  If one tab crashes, it doesn't cause the rest of the threads to crash.
0
 

Author Closing Comment

by:newbieweb
ID: 33469182
Thanks.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question