B
baldrick
Hi,
I have some intensive number crunching code that I want to break up
into threads so PCs with several processors can do the job quicker.
I have a loop that will go from say 1 to 10, and for each value,
different numbers will be crunched depending on what the value is.
As it is an intensive process the user may cancel the loop. I need to
know at what value of the loop the process was cancelled, so it can be
restarted at the next value next time.
My initial thought was to allocate 1-5 to thread 1 and 6-10 to thread
2 (for a 2 processor machine) - which shouldn't be too difficult. But
the issue with this if that if the user cancels then its not so neat
to resume as 1 and 6 might be the only ones completed.
Ideally I would like to do the following but am not quite sure how.
Any pointers or code snippets would be appreciated.
for 1 = 1 to 10 step numProcessors (say 2)
next i
I have some intensive number crunching code that I want to break up
into threads so PCs with several processors can do the job quicker.
I have a loop that will go from say 1 to 10, and for each value,
different numbers will be crunched depending on what the value is.
As it is an intensive process the user may cancel the loop. I need to
know at what value of the loop the process was cancelled, so it can be
restarted at the next value next time.
My initial thought was to allocate 1-5 to thread 1 and 6-10 to thread
2 (for a 2 processor machine) - which shouldn't be too difficult. But
the issue with this if that if the user cancels then its not so neat
to resume as 1 and 6 might be the only ones completed.
Ideally I would like to do the following but am not quite sure how.
Any pointers or code snippets would be appreciated.
for 1 = 1 to 10 step numProcessors (say 2)
next i