Prallel Processing using BackgroundWorker class in multithreading

Feb 17 2011 12:15 AM
Hello,


I want to calculate the value of PI upto 100 decimal places using multiple CPU. If I have four CPU the work is divided among four cpu. Then in that case the first CPU will calculate the value of upto 0 to 25 decimal places. And second CPU simultaneously 2nd CPU will calculate the value upto 25 to 50 decimal places and 3rd CPU will calculate the value upto 50 to 75 decimal places and 4th CPU will calculate upto 75 to 100 decimal places simultaneously. In a way I want to Calculate the value of PI in parallel processing. Main Idea behind the dividing the work in four different CPU is that to process the output fast then using single CPU.

The main logic is that if any single CPU will calculate in 10 sec if that work is divided in four cpu the the work will be fast and it will be completed in approx 4 sec.

I want to use background worker class.


My problem can be solved by reading  the article Real Multi-threading in .NET 2.0
By Jose Luis Latorre published in CodeProject.The link below is the link of the published article
Real Multi-threading in .NET 2.0
But Now I am in trouble how to implement this with multiple CPU. How the main CPU identify his slave CPU and Main CPU will do his work along with his slave CPU? And where the main code will be put.




Thanks,
Deepak

Answers (1)