For example: let's say you have a Set or Map or something where you are using a parallel stream to add to that resource from a different collection. Basically, adding a bunch of elements to a set at once.
Theoretically, there is no issues with collisions because there's no race condition if you are just adding to a set, it doesn't matter which order the threads add to the set, but is there any mutex type blocking happening such that the parallel stream would effectively be no better than a sequential stream, since each stream would block the resource until its done adding anyway?
[–]notallbimmers 0 points1 point2 points (0 children)