Why doesn't performance increase too mcuh in multi threading? Please help

A

AliRezaGoogle

Dear members
I am working with a 2GH P4 Intel, and 512GB RAM.

I have a long list matrix 3000 * 15,000 of type double.
I have a calculation procedure which can be executed on any single
element of the matrix. Regarding to nature of this procedure, it is
possible to run procedure on every element independently. I designed
30 threads. Every thread runs same procedure on equal portion of the
matrix. For example rows from 0 to 100 are dedicated to thread #1 to
execute some calculation on them. There is no data or function
dependency. The only shared data is that matrix.

Before threading, I wrote the program in sequential manner. That, all
of the elements were calculated one by one each after each without any
parallelism.
After threading, I expected to see significant increase in speed of
execution. While I have 30 workers working concurrently. But the speed
increased a little and too less that what was expected.

What is the reason? How can I increase performance much more?
 
H

Hakan Fatih YILDIRIM

Ok.but you are running 30 threads at the same time.so for 30 different
calculati n in the same processor on different threads.The other wise
one calculation..Decrease the number of the threads and recalculate
the time.
i think it would be better

Hakan Fatih YILDIRIM
MCP
 
A

Arunkumar Keserla

Multi-Threaded applications only improve the responsiveness of the application.
They will not speed up your application especially when you have a single
core non hyperthreaded machine. In which case you get performance boosts
by offloading computation to the other core/processor.

Infact multithreading involves context switching which is an overhead. So
your best bet is to upgrade your hardware or use efficient datastructures
(for example choice of datatypes, algorithms & other optimizations)

-A
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top