Solved

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

Posted on 2010-08-18
4
294 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Red error squiggly on vb.net 7 27
Saveas need to save a copy 16 26
Help with sorting data in Listbox using VB.NET 3 53
Error on link 14 36
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
More and more people are using the enhanced small form-factor pluggable (SFP+) tranceivers, and speed is of utmost importance. Testing of speeds are critical to ensure that the devices will meet the speed requirements. There are some testing challen…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

919 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now