المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Threads, speed up calculations



C# Programming
12-31-2009, 10:20 AM
Hi,
i will be appreciated if someone could help me in this situation:

my PC: Pentium 2Core 2.1GHz 4Gb(Ram) windows 7 x64

The problem that I can not solve by myself is how to speed up calculations.
My method runs 850-970ms. method created for image processing (crops image ,recognize coped image and put calculated value into matrix)
When i am using threads (in this example 2 threads)
ThreadStart ts = new ThreadStart(ThreadOneP);
ThreadStart ts2 = new ThreadStart(ThreadTwoP);
Thread thread1 = new Thread(ts);
Thread thread2 = new Thread(ts2);
thread1.Start();
thread2.Start();
thread1.Join();
thread2.Join();

method takes 900-1070ms.

How to speed up that method will take about 400ms? it is possible?

P.S sorry for my English http://www.barakasoft.com/script/Forums/Images/smiley_smile.gif