I am sure this is straightforward to many of you, but I am at a loss. I have read the examples, and searched for responses to other inquiries on the topic, but I am stuck. I have a program that has to loop through 511*511 combinations of comparisons to determine two output values (in this case - two character codes from 0 to 255) from a given set of input coordinates in an image. Since the determination of the optimal characters are independent of each other and because the code executes far too slowly I am trying to use additional threads to do that calculation.
I want to be able to do this (not real code, conceptual), x and y are values to send to the thread and I want it to spit back mini and minj. x is from 1 to 320, y is from 1 to 200, mini and minj are from 0 to 255. mini and minj are found at the same time and both variables need to come back
Code: Select all
for y=1 to 200 step 8
for x=1 to 320 step 8
param = threadcreate (x,y)
returni=param.mini
returnj=param.minj
.... do stuff with the return values ...
next x
next y
threadwait (wait for them all to finish)
... move on ...
Help?
Thanks,
Chris