I like this idea, but unfortunately I don’t have enough memory to double-buffer the maps. I could break the work in to partial map updates, and push the results to the full map with mat::copyTo(). (I think that would work). Breaking it into sub-jobs would also let me rate-limit the update process so I don’t hog the CPU.
The main downside is the additional copyTo() overhead, but I think that’s likely to be small. There is also some synchronization work / overhead, but again probably not a big issue. Architecturally it might actually be cleaner / more maintainable.
I’ll probably give this a shot next.
Thanks.