Home › Forums › C Programming › Parallel Processing in win32
- This topic has 1 reply, 2 voices, and was last updated 16 years, 11 months ago by shalizy.
- AuthorPosts
- July 20, 2007 at 1:46 am #1988serkanParticipant
Hi,
I am new to the forum. I am doing some kind of C++ programming. which is win32 console application in a .NET IDE. Actually I had 10 different objects they call a particular function to accomplish their task. for eg
12345678MyObject1 *obj1 = new MyObject1();<br />obj1->dosomething();<br /><br />MyObject2 *obj2 = new MyObject2();<br />obj2->dosomething();<br /><br />MyObject3 *obj3 = new MyObject3();<br />obj3->dosomething();what happens the dosomethings() function is called sequencially and done one after another and takes 10 second. Can I reduce the time by making use of threads. How to know about threads as beginner. Any site which is useful as a tutorial for me.
Please suggest
thanks - January 11, 2008 at 5:59 am #3239shalizyParticipant
You can do but code should be parallel. Here function is same,That’s fine. But No variables b/w those call should not be shared.
Example: Parallel programming using By OpenMP API
1234567891011121314151617#pragma omp sections num_threads(3)<br />{<br />#pragma omp section<br />{ <br />Fun1();<br />}<br />#pragma omp section<br />{ <br />Fun2();<br />}<br />#pragma omp section<br />{ <br />Fun3();<br />}<br />}<br /><br />Then Here three threads execute parallelly.
- AuthorPosts
- The forum ‘C Programming’ is closed to new topics and replies.