NativeStream usage.

Is NativeStream like a NativeList you can write to in parallel? If not, how is it different?

That’s not how you use it. Only one thread is ever allowed to write to a ForEachIndex, and only once.

NativeStream’s purpose is for when you have a job with an array of producers and another array of results, and while you know the number of producers, you don’t know in advance how many results each producer will produce. NativeStream handles this case in parallel and deterministically.

2 Likes

Thank you!