Hi all I developed an application that computes many calculations and the time is not so good. I want to increase the execution time. My questions is: Using multithreading it's possible to increase my speed ? This is for C language on Linux Kernel 2.6.29. If I have for(i=0;i<100000000;i++); using two threads my execution time will be better ? Thanks a lot!
Fast time execution
In the example you give using multiple threads would make it worse. You need the same number of CPU cycles plus the overhead of switching between the threads. Threads will only help if you have a wait state at some point in the calculation that you can then give CPU time to a separate thread. From what i understand, usually multiple threads wont help a straight calculation. You'd be better off trying to optimize what you've got i,e. more efficient C or dropping to assembly. Well that's my opinion anyway!