Icrontic reporting in from SIGGRAPH 2008 - Keynote
Thermalright TRUE Black 120 Heatsink Review
Crazy Gadget Guy tries to crash the D-Link DIR615 router.

Multi-threaded software explained

Icrontic's Matthew Broadbent clues us in

by Matthew Broadbent published Jan 7, 2008

Filed under: applications, processors

Being new to the world of multi-core processors, I always wondered what the true potential of these new chips really was. Before I purchased mine, I did some research into applications that utilise these new features, and found the information was not readily available. Therefore I decided to write a quick guide, and maybe encourage people to use the full potential of their new investment.

First of all it's important to understand what a multi-threaded application really is. By definition, it is a piece of software that is aware of more than one core/processor, and can use these to be able to simultaneously complete multiple tasks. A common mis-conception is that single-core systems are not able to multi-thread. In reality, they are simply performing multi-tasking among multiple threads or programs. But this in itself can cause problems, because many threads are sharing the same hardware resource, and so slow each thread down individually.

And so the multi-core processor was born, allowing a system to give full core support to a single thread. This not only allows multiple single threaded applications to be run at the same time, but also for the mentioned multi-threaded software to be used. Now being able to use multiple cores for a single application will require software to be coded specifically for this task. I have attempted in someway to explain multi-threading in a simple, yet concise way, using some analogies (Where the bank represents the processor, the clients represent the threads within a program or in different programs, and the queues ... well the queue for processor time.)...

A single-threaded program

Imagine a bank, with one cashier and one queue. A customer walks in, and walks straight to the cashier, and they begin serving the customer. A second customer walks in, and is forced to join the queue. He or she complains that they are unhappy with the service, and protests to the cashier that they want to be served. The cashier has rono choice but to ask the first customer to wait, while he serves the other customer. The original customer then has to wait until the other customer has finished before he or she can continue being served, meaning he or she not only has to wait, but has to waste time by getting out and arranging all the documents he or she has brought with them. It is simply inefficient management.

A multi-threaded program

Imagine the same bank, but this time there is two cashiers. The first client is being served, and the second client walks into the branch. Instead of joining the queue for the first cashier, the second client walks over to the second cashier, and serves him or her. In this case, both clients are able to be served simultaneously, and without effecting the efficiency or time it takes for each client to be completely serviced.

Examples

What follows are some example applications, with a brief analysis of each.

1 2 3Next »

About the author

Matthew Broadbent

Matthew Broadbent is a right proper English Gentleman.

9 Comments

Register to comment (quick and free)

  1. broady81 said Jan 10, 2008 3:24pm (ET)

    Can I please invite all of you who have read the article to leave any constructive criticism you may have regarding my work This is my first article here on Icrontic, and I would love to know any areas of improvement that I can focus on for any future writing I do. Thanks for reading and I hope you enjoyed it nonetheless

  2. lemonlime said Jan 10, 2008 6:30pm (ET)

    Great read, Broady. I know there are many not-so-technical people out there who still think a 3GHz dual core is a 6GHz processor and don't consider the software design required to harness the power.

  3. Thrax said Jan 10, 2008 6:42pm (ET)

    SHAMELESS SELF PROMOTION: This thread goes well with my explanation of a quad core chip - http://icrontic.com/articles/quad_core

  4. yagga said Jan 12, 2008 12:23pm (ET)

    Correct your spelling of "Stnaford." This really distracts me.

  5. broady81 said Jan 12, 2008 5:52pm (ET)

    I have a small admission to make - I didn't write that sentence. Keeb's added it, I presume to provide a link to our folding efforts that I had forgotten to include. I'm hoping he knows about it, and it will be corrected any other comments ?

  6. Keebler said Jan 12, 2008 6:00pm (ET)

    I have a small admission to make too... I'm not the one who edited your article It's fixed.

  7. mondi said Jan 12, 2008 8:01pm (ET)

    By definition, it is a piece of software that is aware of more than one core/processor, and can use these to be able to simultaneously complete multiple tasks.


    This is incorrect. By definition, a multi threaded application is an application that has more than 1 thread of execution.


    A multi-core processor has more available threads


    No, a multi-core processor has more available cores. Each core can only execute a single thread at any one point in time (exception granted for superscaler cpu's). While there are limits to the number of threads that can be executed at any one time, that limit is most often imposed by the operating system.

  8. CB said Jan 12, 2008 8:12pm (ET)

    Do we know that guy?


  9. GHoosdum said Jan 14, 2008 9:45pm (ET)

    mondi!

Register to comment (quick and free)