On a quad-core machine, I am considering the parallelization of C#/.NET algorithm which involves having multiple threads reading the small int[] array concurrently. So far, it seems to be working rather well, but I am not sure where it is specified that concurrent reads on an array are thread-safe in .NET. Any pointers?
Then, I am also wondering if this approach is really efficient? Are there situations where you are better off actually duplicating the input data for each thread, so that there isn't any concurrent read, and each array (maybe?) gets the opportunity to be cached near affinity CPU?
Any thoughts on the best practices in respect of multicore CPUs?
I don't think there's a problem with concurrent reads. It could be problematic if there are concurrent writes, though.
Immutable data is inherently thread-safe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With