ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Multi-threaded software

<< < (2/3) > >>

jgpaiva:
Right now, I can't confirm this, but I'm pretty sure that a program being multi-threaded doesn't directly imply that it will run on 2 cores at the same time.
For this to happen, it needs to be programmed in something like OpenMP.
Still, one single application rarelly has the expected benefits from running in 2 processors, by Amdahl's law, which proves that if you have a serial part in your program (which all programs usually have), the speedup you get by adding more processors is severely limited (see the graph on the page to get a better idea).

So, like mouser mentioned, the best benefit is when you run several concurrent applications.

PS: I'm on vacations and can't test what I mentioned in the beggining of the post. Could someone just make a multithreaded app in C++ or Java or something and check if both cores are used? thanks

f0dder:
Multithreaded does mean you run on several cores (well, generally), but it doesn't necessarily mean you get much advantage from it - ie., if you have threads that's mostly asleep, for instance. And you obviously do need to create multiple threads first, just (for instance) linking against multi-threaded C runtime doesn't really help ;).

For typical CPU-intensive stuff, it can be a pain parallelize your algorithms. OpenMP and compiler support can help, but I dunno how well it works - you still need to think yourself, and add hints for the compiler.

For stuff like internet servers, the situation is probably a bit easier (set up a thread pool and handle clients from that), but still not exactly trivial - you need to consider race conditions, deadlocks, synchronizing access to shared state, et cetera.

But this is drifting away from the topic of listing software that has efficient use :)

Lutz_:
Some programs certainly will make better use of multi-core cups than others. The RAW converter Bibble is certainly proud of the multithreading performance in their coming version 5.   They have a video there showing efficient 16 core usage.

http://bibblelabs.com/products/bibble5/b5-16wide/

f0dder:
Some programs certainly will make better use of multi-core cups than others. The RAW converter Bibble is certainly proud of the multithreading performance in their coming version 5.   They have a video there showing efficient 16 core usage.

http://bibblelabs.com/products/bibble5/b5-16wide/
-Lutz_ (July 30, 2008, 05:13 PM)
--- End quote ---
That probably has quite a coding advantage, though: "I converted 116 RAW images from a Canon 1D Mark 2 dSLR from RAW to JPEG in about 1/12th the time of other software running on the same machine." - even if they haven't got the algorithms themselves multi-threaded, they can just launch 16 worker threads each processing a file at a time. (OK, disk I/O is still something you need to handle efficiently to avoid thrashing, but still...)

azza:
In terms of performance gains from multi-threaded applications, there is a performance hit from synchronization of shared data sources between multiple threads.  So if you have different threads working on the same data structure you won't see twice the performance from a 2 threaded application.  Obviously it depends how heavily the application will be working with these shared data sources as to how much of a performance hit there is.
However if the application is working on distinct sets of data (for example different .mp3 files) then a doubling of performance is relatively easy to achieve, subject to other bottlenecks in the system.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version