"People who are unable to motivate themselves must be content with mediocrity , no matter how impressive their other talents " -Andrew Carnegie
Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
BEE MBA PMP SCJP-6
BEE MBA PMP SCJP-6
Peter Taucher wrote:
First of all you never executed the threads concurrently ... only one at a time was running. I'm sure that's not what you wanted. With the modifications at least different threads concurrently modify the jacobi array. I don't really know what you're trying to achieve. In each thread you go through the loops and for each thread count therefore get another result.
Peter Taucher wrote:
The threads may concurrently modify entries of the array that other threads may use as operands for their next calculatione therefore I don't think you'll get a defined result that easily.
"People who are unable to motivate themselves must be content with mediocrity , no matter how impressive their other talents " -Andrew Carnegie
BEE MBA PMP SCJP-6
Jim Hoglund wrote:Sanjay : This is not a debate. We are trying to help you see problems with your design.
Please study my previous response. It explains why there would be inconsistent results,
as Peter identified in his post, and shows one way to avoid this problem. Please do not
make us feel that we are wasting our time in trying to help.
Jim ......
"People who are unable to motivate themselves must be content with mediocrity , no matter how impressive their other talents " -Andrew Carnegie
BEE MBA PMP SCJP-6
Jim Hoglund wrote:Thank you for the quick response. I will have some
time to work on your questions tomorrow.
Jim ......
"People who are unable to motivate themselves must be content with mediocrity , no matter how impressive their other talents " -Andrew Carnegie
BEE MBA PMP SCJP-6
Jim Hoglund wrote:Okay, EACH_THREAD is a limit on how many cells will be calculated by one thread.
I just plugged in a number that will cause a few threads to die early, before the table
is completely filled in. This assures that multiple threads will run, demonstrating what
you want to see.
Did you run the program? It has two output grids. One is the calculated grid and the
other shows the thread number that calculated each cell. I would be happy to address
any other questions you have.
Jim ......
"People who are unable to motivate themselves must be content with mediocrity , no matter how impressive their other talents " -Andrew Carnegie
BEE MBA PMP SCJP-6
Steve
There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|