10 ms·
All excellent points, and I would add that it changes the semantics of the code when it comes to threading, which is will be a more and more major issue going f
by wnissen 11y ago
All excellent points, and I would add that it changes the semantics of the code when it comes to threading, which is will be a more and more major issue going forward. If the variable is declared outside the parallel section (such as a for loop), it's assumed that it is shared (and therefore synchronized), while if it's declared inside it is clearly private to each thread and no synchronization is required.
- bluecalm 11y agoWe are talking about top of the block. When you are creating a parallel section you have a new block/scope there so that argument doesn't apply. Both styles are the same when it comes to scope of the variables.