I know you have to synchronize your threads to be able to change your global variables content safely in a multithreaded application (where multiple threads are trying to change the variable data at the same time). But is this also necessary if you use a global array, where each thread only uses one of the n elements?
Thanks in advance!
If each thread only uses one element, and the array's location in memory is never changed, then it's absolutely safe without synchronization.
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