|
-
May 10th, 2011, 08:43 PM
#16
How to program multicore
Is it appropriate to have a program that uses a core to do an intensive calculation and another core to output the results simultaneously on a dualcore machine? can i use MPI library to do this task?
I tried multithreading on a dualcore machine with the same idea that one thread does the calculation while the other thread displaying results, but the two cores do not process simultaneously.
Thanks,
-
May 11th, 2011, 08:35 AM
#17
Re: How to program multicore
I tried multithreading on a dualcore machine with the same idea that one thread does the calculation while the other thread displaying results, but the two cores do not process simultaneously.
And how did you find that out?
Best regards,
Igor
-
May 11th, 2011, 12:36 PM
#18
Re: Multithreading
I look at the performance tab in task manager. I also timed it, the running time on dualcore machine does not improve a lot compared to the one core machine.
-
May 11th, 2011, 12:57 PM
#19
Re: How to program multicore
 Originally Posted by ktxn
..., but the two cores do not process simultaneously.
Why would you expect them to? According to your description, the first thread does intensive calculations and the second thread displays results. Assuming that the two thread are on separate cores (probably reasonable), then the the second thread has nothing to do until the first thread sends it results for display. This matches your observed behavior.
In your scenario, mutithreading provides the advantage that the GUI stays alive while the intensive calculation proceeds. But in this scenario, multithreading does not provide a time/speed advantage.
To obtain a time/speed advantage, the intensive calculation must itself be multithreaded. That generally can be hard to do, unless the intensive calculation has some nice parallel properties.
Mike
Last edited by MikeAThon; May 11th, 2011 at 01:00 PM.
-
June 29th, 2011, 02:55 PM
#20
Re: Multithreading
In programs there are threads. Threads are doing process. There are many thread with performing different processes. At a time we can do many process with the help of multi threading. Threads have many states like start,intiate,stop,turminate.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|