Multithreading on Cartesian products

Maybe I’m missing the issue, but a very simple answer would be to just call vec(collect(complicated_product_iterator)), and then whatever you were doing for a vector would again work just fine. You probably could get away with something almost as easy while still avoiding the collect, perhaps using Transducers.jl or something, but unless the storage or cost of calling collect are substantial compared to what you’re doing with those indices, you could probably just do it and be done.