Writing concurrent programs can be easy, but ensuring their correctness and optimality can be tricky, especially when dealing with multi-threaded programs.
So, isn't updating the Global variable like CurrentNum a bottleNeck for this situation, say if like I got 1024 threads working simultaneously.
Also can you tell me a bit more on how would you deal with race condition( not the correct term but similar) in this situation, where multiple threads could try to access and update the same variable.
So, isn't updating the Global variable like CurrentNum a bottleNeck for this situation, say if like I got 1024 threads working simultaneously.
Also can you tell me a bit more on how would you deal with race condition( not the correct term but similar) in this situation, where multiple threads could try to access and update the same variable.