0

I have a computation over the thousands of items that needs to process a sequence of computation where each n iteration need to process data of [n - 1, n, n + 1]. Better to understand this on the chart chart of iterations

All the computations inside iterator are same so we can cache it. But what is the best way to do it with rayon?

I thought to cache it based on the thread level. So if we have 4 threads that iterates over we can have cache for each group (0 - n/4, n/4 - 2*n/4, ..) but we can not control the sequence of iteration in rayon.

Is there any better way of having per-thread or shared cache in rayon without mutexes?

Important note: I don't know which iteration will need to make a calculation. It determines in runtime, so basically I can not make all the calculations before iterations.

Dmitriy Kovalenko
  • 3,437
  • 3
  • 19
  • 39

0 Answers0