Solved

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

Posted on 2010-08-18
4
339 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 167 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 167 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 166 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

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In the modern office, employees tend to move around the workplace a lot more freely. Conferences, collaborative groups, flexible seating and working from home require a new level of mobility. Technology has not only changed the behavior and the expe…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

696 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